How to Find Public IP Address using Linux Terminal. Ok so in this article i will share how to find public IP address using linux terminal. There are many ways to find out your public IP address or wan (Wide Area Network) IP on a Linux or Unix-like operating systems.
Using Dig Command
We can check our public IP using dig command on terminal linux.
OpenDNS
dig myip.opendns.com @resolver1.opendns.com +short
dig TXT o-o.myaddr.l.google.com @ns1.google.com +short
Akamai
dig whoami.akamai.net. @ns1-1.akamaitech.net. +short
Using Nslookup Command
OpenDNS
nslookup myip.opendns.com resolver1.opendns.com
nslookup -type=txt o-o.myaddr.l.google.com ns1.google.com
Akamai
nslookup whoami.akamai.net. ns1-1.akamaitech.net.
Using Host Command
OpenDNS
host myip.opendns.com resolver1.opendns.com
host -t txt o-o.myaddr.l.google.com ns1.google.com
Akamai
host whoami.akamai.net. ns1-1.akamaitech.net.
Using cURL Command
Using curl is the simplest way. But for security reason this is not recommended.
curl -sKL ident.me | xargs echo
curl ifconfig.co
curl icanhazip.com
curl -sKL ifconfig.me | xargs echo
After you find the public IP, you can check full information about your IP using whois command.
Ok. So, that’s for today. Ask me everything if you have any problem with this tutorial. And dont forget to share it if you think it is helpful. Thank you and see you in the next tutorial.