PDA

View Full Version : [ubuntu] command to know location from ip?



uarale
December 15th, 2008, 08:33 PM
hi,

sometimes i want to know where is a person come from? all i know is the ip he uses. of course i can go to sites such as ip2location to get the information i want. but openning a heavy page just to know that is like a pain!

anyone could suggest a command to handle this in terminal?

Achetar
December 15th, 2008, 09:04 PM
There is none that I know of. You might could build a list of regions that use certain google.com and ISP servers and crossreference that with a traceroute, but that is a lot more work than you probably want to do.

I would be interested as well if anyone has a better answer

Viranh
December 15th, 2008, 09:06 PM
The utility "tracert" can give you some information about an ip address. I'm not sure this is quite what you're looking for, but you can give it a try.


sudo apt-get install traceroute
sudo tracert <ip address>

It's funny, I've used this command on Windows a bit, so I typed it in the terminal to see if Linux had something similar, and it worked (almost, the extra arguments may be different) exactly the same.

Bachstelze
December 15th, 2008, 09:07 PM
The free edition of GeoIP (apt-get install geoip-bin) gives you the country:


firas@nobue ~ % geoiplookup 88.191.79.242
GeoIP Country Edition: FR, France