←back to thread

980 points nkcmr | 1 comments | | HN request time: 0.314s | source
Show context
yakubin ◴[] No.27416355[source]
There was a thread[1] a couple months ago where I discovered a method to get one's IP address relying only on DNS:

  nslookup myip.opendns.com resolver1.opendns.com
I love it.

[1]: <https://news.ycombinator.com/item?id=26634476>

replies(2): >>27416377 #>>27416617 #
1. moreati ◴[] No.27416617[source]
That will return an IPv6 address, if you have IPv6 connectivity. That's normally be fine, but for occasions it isn't there is

    dig +short -4 myip.opendns.com a @resolver1.opendns.com