Skip to content

Instantly share code, notes, and snippets.

@svmt
Created July 15, 2017 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svmt/af50c54d27896ad9e7cb6d51c86cf7da to your computer and use it in GitHub Desktop.
Save svmt/af50c54d27896ad9e7cb6d51c86cf7da to your computer and use it in GitHub Desktop.
WAN IP from Bash
Using dig with OpenDNS as resolver:
dig +short myip.opendns.com @resolver1.opendns.com
Perhaps alias it in your bashrc so it's easy to remember
alias wanip='dig +short myip.opendns.com @resolver1.opendns.com'
Responds with a plain ip address:
$ wanip
80.100.192.168
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment