Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm writing a script that does dynamic DNS updates for me, but my server is behind a router, and so I need to use a web service to determine my public IP.

So far I've found this one which returns just your plain IP. I was looking around trying to find a couple of alternatives to use in my script supposing that that one is down, but I can't find any others that return just the IP as plaintext.

These ones return some HTML, but I really don't want to bother parsing HTML when what the script needs to do is such a simple task.

Does anyone know of some other reliable services which return only your public IP in plaintext?

share|improve this question

closed as off-topic by Nifle, DragonLord, Kevin Panko, Matthew Williams, Raystafarian Dec 8 '14 at 12:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – Nifle, DragonLord, Kevin Panko, Matthew Williams, Raystafarian
If this question can be reworded to fit the rules in the help center, please edit the question.

4 Answers 4

up vote 19 down vote accepted

Famous one – I can haz IP:

$ curl icanhazip.com

And that's it.

share|improve this answer
thanks! - the name is definitely a bonus. –  Alex Coplan May 5 '12 at 16:54
True. It's actually the first one I really remember. –  slhck May 5 '12 at 16:56
icanhazip.com is not very reliable. Once every few times, the site doesn't answer at all. –  Serge - appTranslator Aug 21 '12 at 14:06

see page http://wtfismyip.com, http://wtfismyip.com/text actually on. Get ip address in the form of text. XML or JSON formats too.

or get http://checkip.dyndns.com/ but format is "Current IP Address: xxx.xxx.xxx.xxx"

share|improve this answer

I use http://checkip.amazonaws.com/

curl -s http://checkip.amazonaws.com/

(This form miscounts the above 82 characters as 15 characters, so I have to enter an extra sentence.)

share|improve this answer
I had to stop using this service last week, possibly because my ISP started doing something weird. Now I use ipinfo.io/ip , which is free to use for up to 1k queries/day; see ipinfo.io/developers . –  Polyergic Jul 29 at 17:07

Or you could host your own. Use a free hosting company, and using PHP use a code like this:



share|improve this answer
Of course I could do that, but surely there must already be plenty of services out there which do this already. –  Alex Coplan May 5 '12 at 16:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.