Skip to content

Instantly share code, notes, and snippets.

@rkalkani
Created June 28, 2020 08:43
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save rkalkani/7428a8769f7cc6710c58680938dc5833 to your computer and use it in GitHub Desktop.
Save rkalkani/7428a8769f7cc6710c58680938dc5833 to your computer and use it in GitHub Desktop.
Get public IP address used by your machine to connect to the internet

Get Public IP

DNS

Google

dig o-o.myaddr.l.google.com txt @ns1.google.com +short
# OR
nslookup -type=txt o-o.myaddr.l.google.com ns1.google.com

Cloudflare

dig whoami.cloudflare ch txt @1.1.1.1 +short

Akamai

dig whoami.akamai.net. @ns1-1.akamaitech.net. +short
# OR
nslookup whoami.akamai.net. ns1-1.akamaitech.net

OpenDNS

dig whoami.akamai.net. @ns1-1.akamaitech.net. +short
# OR
nslookup whoami.akamai.net. ns1-1.akamaitech.net

HTTP

curl ipinfo.io
curl ifconfig.co
curl icanhazip.com
curl ifconfig.me
curl checkip.dyndns.org
@axoroll7
Copy link

It seems that you wrongly copy-pasted Akamai to OpenDNS. (sorry for bad english)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment