Linux Tips

How To Discover Out Public IP Deal with From Command Line On Linux

SEOClerks

How do you discover out the general public IP? Straightforward! There are quite a few strategies/apps obtainable to do that in graphical person mode. Open your net browser and go to WhatIsMyIP.com web site. There you possibly can see your public IP. It is among the hottest technique to search out out your public IP handle, no matter any Working system. All you want is an Web connection and an online browser. However, the right way to discover out public IP handle from command line? That’s what we’re going to see on this information.

Discover Out Public IP Deal with From Command Line On Linux

There many instructions to search out the general public IP handle. Right here I’ve listed a few of them. Attempt all strategies and decide one which fits you. Good luck!

We will discover the general public IP handle utilizing ‘dig’ and ‘host’ instructions. If dig and host instructions aren’t obtainable in your system, set up dnsutils package deal.

On Arch Linux and derivatives:

$ sudo pacman -S dnsutils

On RHEL, CentOS, Fedora:

$ sudo yum set up dnsutils

Or,

$ sudo dnf set up dnsutils

On Debian, Ubuntu and its derivatives:

$ sudo apt-get set up dnsutils

Now, allow us to discover the general public IP.

Methodology 1:

Allow us to discover out public IP with Google resolvers utilizing dig command:

$ dig TXT +brief o-o.myaddr.l.google.com @ns1.google.com | sed ‘s/”//g’

Alternatively, use this command to search out out the general public IP:

$ dig TXT +brief o-o.myaddr.l.google.com @ns1.google.com

Can I get the identical information with opendns resolvers? Sure, you possibly can!

$ dig +brief myip.opendns.com @resolver1.opendns.com

Methodology 2: 

We will get the identical information utilizing host command.

$ host myip.opendns.com resolver1.opendns.com

Pattern output:

Utilizing area server:
Title: resolver1.opendns.com
Deal with: 208.67.222.222#53
Aliases:

myip.opendns.com has handle 122.178.32.233
Host myip.opendns.com not discovered: three(NXDOMAIN)
Host myip.opendns.com not discovered: three(NXDOMAIN)

Methodology three:

You should use curl command to search out the general public IP of your system from a third-party web sites. I don’t suggest discovering IP handle utilizing third-party websites resulting from safety causes. Be cautious!

Right here is few examples.

$ curl ipinfo.io

Pattern output:

{
“ip”: “122.178.32.233”,
“hostname”: “abts-tn-dynamic-233.32.178.122.airtelbroadband.in”,
“metropolis”: “Coimbatore”,
“area”: “Tamil Nadu”,
“nation”: “IN”,
“loc”: “10.9925,76.9614”,
“org”: “AS24560 Bharti Airtel Ltd., Telemedia Providers”,
“postal”: “641001”

curl is put in by default. If it isn’t put in by any probability, run the next command to put in it.

On Arch Linux and derivatives:

$ sudo pacman -S curl

On RHEL, CentOS, Fedora:

$ sudo yum set up curl

Or,

$ sudo dnf set up curl

On Debian, Ubuntu and its derivatives:

$ sudo apt-get set up curl

Right here it’s one other technique to search out the general public IP.

$ curl https://wtfismyip.com/textual content

Pattern output:

122.178.32.233

The opposite helpful strategies to search out out the general public IP handle are given beneath.

$ curl api.ipify.org
$ curl https://ipinfo.io/ip
$ curl ipecho.web/plain
$ curl ifconfig.co
$ curl ident.me
$ curl icanhazip.com
$ curl ip.appspot.com

And, that’s all for now. Which technique are you utilizing to search out the general public IP? Let me know within the remark part beneath. I’ll examine and replace this information.

Pleased weekend!

Cheers!!

Thanks for stopping by!

Assist us that will help you:

Have a Good day!!

Source link

Related Articles

Leave a Reply

Back to top button