4,461
edits
Get public IP address from CLI |
→Get public IP address from CLI: add a third option |
||
Line 48: | Line 48: | ||
== Get public IP address from CLI == | == Get public IP address from CLI == | ||
<source lang=" | <source lang="console"> | ||
$ dig +short myip.opendns.com @resolver1.opendns.com | $ dig +short myip.opendns.com @resolver1.opendns.com // this one doesn't seem to work | ||
$ dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}' | $ dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}' | ||
$ wget -qO- http://ipecho.net/plain | xargs echo | |||
</source> | </source> |