I need to find out WAN IP address. How do you get external ip on command line? What command I need to type?
Get external IP on Linux or Unix command line
- Open the terminal
- Type the following command
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
- We can also use host command:
host myip.opendns.com resolver1.opendns.com
A note about MS-Windows users
- Open prompt
- Type the following nslookup command:
nslookup myip.opendns.com. resolver1.opendns.com
See my guide for more information
https://www.cyberciti.biz/faq/how-to-find-my-public-ip-address-from-command-line-on-a-linux/