Skip to content

Instantly share code, notes, and snippets.

@flatlinebb
Last active August 25, 2022 17:10
Show Gist options
  • Save flatlinebb/e1ea237ba206f51b8380f71e102f85ca to your computer and use it in GitHub Desktop.
Save flatlinebb/e1ea237ba206f51b8380f71e102f85ca to your computer and use it in GitHub Desktop.
All the various ways to obtain the WAN IP of a Windows or Linux computer:
curl ifconfig.me
(curl ifconfig.me).Content
wget -qO- http://ipecho.net/plain | xargs echo
host myip.opendns.com resolver1.opendns.com
dig +short myip.opendns.com @resolver1.opendns.com.
dig +short txt ch whoami.cloudflare @1.0.0.1
nslookup myip.opendns.com. resolver1.opendns.com
(Invoke-WebRequest -uri "http://ifconfig.me/ip").Content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment