• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

LinuxSec Blog

Linux Tutorial for Beginners

  • About Me
  • Categories
  • Linux Blog
  • Hacker News
  • Geekbench
You are here: Home / Terminal Command / How to Find Public IP Address using Linux Terminal

How to Find Public IP Address using Linux Terminal

June 21, 2020 by Jack Wilder Leave a Comment

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.

Shares

Filed Under: Terminal Command






Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Random Post

How to Enable REMI Repository in CentOS 8

Leave a Comment

Netdata – Real-time performance monitoring, done right!

Leave a Comment

How to Change Hostname in CentOS 8

Leave a Comment

How to Reset MariaDB Root Password on CentOS 7

Leave a Comment

The Future Plan for This Blog

Leave a Comment

Ads


Powered by WordPress and Genesis Framework. Style by LinuxSec.