How to Find Public IP Address using Linux Terminal

Posted on

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

Google

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

Google

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

Google

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.

Gravatar Image
Budak korporat yang hobi nulis. Pengguna Kali Linux sebagai daily driver. Kadang nonton anime di waktu luang.

Leave a Reply

Your email address will not be published.