Skip to content

Instantly share code, notes, and snippets.

@ccondry
Created January 23, 2020 19:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccondry/3f55e345aa37b23a41acee6405cabda9 to your computer and use it in GitHub Desktop.
Save ccondry/3f55e345aa37b23a41acee6405cabda9 to your computer and use it in GitHub Desktop.
get public IP
#!/bin/sh
dig +short myip.opendns.com @resolver1.opendns.com
# or use the following:
# dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
@ccondry
Copy link
Author

ccondry commented Jan 23, 2020

this gets the NAT public IP for a linux computer

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