Hacker News new | ask | show | jobs
by homebrewer 476 days ago
A reminder that you do not need websites or an HTTP client to learn your public IP:

  dig @resolver1.opendns.com myip.opendns.com TXT +short
  dig @ns1.google.com o-o.myaddr.l.google.com TXT +short
dig can be replaced with any DNS lookup utility (nslookup, drill, etc).
4 comments

The former should be

  dig -4 @resolver1.opendns.com myip.opendns.com A +short
  dig -6 @resolver1.opendns.com myip.opendns.com AAAA +short
Unless you're on a network that blocks all dns traffic not to their own dns servers.
The open DNS query failed for me with: "Query A or AAAA for your source address as seen by the resolver" But, the google nameserver did work. Thanks!
Really rolls off the tongue, going to put it with my useful numbers like 0118 999 881 99 9119 725 3.