Skip to content

Comment on Pretty IP Address lookup

Comments

Personally, I much prefer the design of http://ip.appspot.com/

And for the sake of convenience, alias the following to something simple like "ip":

  curl -L -s --max-time 10 http://ip.appspot.com | egrep -o -m 1 '([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}'

What do you need the grep for?

Probably so you know that the output you received is definitely an IP if egrep returns 0. The script on the server could fail or return unexpected non-IP output.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.