Sometimes we are working on some Linux Servers on which some internal LAN IP is allocated and we want to know our public IP address which is recognizing us outside the world.

So how can we know about this and what we can initiate from our own system…?

We can directly ask our network admin guy. But there are also one other way to find it directly from Linux command line. Let’s see some of them.

[root@srv3 ~]# wget -q -O - checkip.dyndns.org
<html><head><title>Current IP Check</title></head><body>Current IP Address: 120.56.201.176</body></html>

[root@srv3 ~]# wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
120.56.201.176

[root@srv3 ~]# curl -s checkip.dyndns.org
<html><head><title>Current IP Check</title></head><body>Current IP Address: 120.56.201.176</body></html>

[root@srv3 ~]# curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
120.56.201.176

We can also used any text browser that support Linux terminal like elinks for same

[root@srv3 ~]# elinks checkip.dyndns.org