Getting Your Public IP Address

by
, posted

As a developer or a computer geek, there are lot of situations when you might see a need to get your Public IP Address. There are many websites in the wild to help with that. But more often than not they are bloated with ads & dozen of unnecessary scripts & trackers making the overall experience disappointing.

The services I’m suggesting are ad free, minimal & work using different protocols like HTTP(s), DNS, SSH & return results in formats like plain text, DNS records and even in JSON.

Get Public IP via Browser

To get your public IP in browser simply open any of these URLs in your browser

If you want to get more specific you can request to get the public IP address in different formats, and even with geolocation data.

Get Public IP via Command Line

Here are simple one line commands to request your public IP address in terminal

$ curl https://ident.me/
$ dig +short @ident.me
$ wget -qO- https://ident.me/ 

# -q :  Quite mode, turn off output
# -O : Display results to standard output

Beautify JSON output data using jq command

$ curl https://ident.me/json | jq

{
  "ip": "185.128.24.187",
  "aso": "M247 Europe SRL",
  "asn": "9009",
  "continent": "AS",
  "cc": "SG",
  "country": "Singapore",
  "city": "",
  "postal": "",
  "latitude": "1.29290",
  "longitude": "103.85470",
  "tz": "Asia/Singapore"
}

Spoiler: that is me connected to VPN xD

Get the DNS records

You can even get DNS records of a given domain. Simply type https://dnsrecords.io/<domain-name-here> in your browser, for e.g

That is all for today. Hope you found these tools useful.

Reply via mail

Your Signature