PDA

View Full Version : [ubuntu] Find external IP terminal



Bananasdoom
December 27th, 2010, 11:12 PM
I need to know my external IP so that I can host a minecraft server, use RDP and many other things I have used www.whatismyip.com (http://ubuntuforums.org/www.whatismyip.com) to get this information but is there a terminal command for this because
ifconfig only shows my local address.

Verbeck
December 27th, 2010, 11:15 PM
edit; after googgling a little bit, found a better one;


wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

Bananasdoom
December 28th, 2010, 12:04 AM
edit; after googgling a little bit, found a better one;


wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'


Thanks for that it did not work completely, I was able to get my ip by going via there simplified automated page


$ curl www.whatismyip.com/automation/n09230945.asp

bodhi.zazen
December 28th, 2010, 12:27 AM
How about simply:


curl ifconfig.me

OliverHaslam
June 2nd, 2012, 08:24 PM
How about simply:


curl ifconfig.me


Old post, I know, but just wanted to say thanks for this. I've been wanting something like this so I could write a script to check my web server's current IP and email me if it changes for domain forwarding purposes. This is perfect.

Cheers!