Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does geographic lookup by IP work?

Is which IPs are assigned to which ISPs public information? How do geo IP services obtain this information and maintain this information?

How can I personally figure out where a certain IP belongs without using one of these services?

like image 218
Brian R. Bondy Avatar asked Nov 08 '08 03:11

Brian R. Bondy


People also ask

How does IP-based geolocation work?

IP geolocation is the mapping of an IP address to the geographic location of the internet from the connected device. By geographically mapping the IP address, it provides you with location information such as the country, state, city, zip code, latitude/longitude, ISP, area code, and other information.

Can you find a geographical location with an IP address?

There is no method of associating an exact physical geographical address or the computer associated with an IP address available to an end-user. If you need to report abuse by a person behind an IP address, contact local authorities or the ISP who's in control of that IP address.

How accurate is IP geolocation?

IP-based geolocation services provide 55 percent to 80 percent accuracy for a user's region or state. And they provide 50 percent to 75 percent accuracy for a user's city. In practice, the actual accuracy may vary from provider to provider and depending on the location of the device.


2 Answers

For what it's worth, I worked at a senior level in the ISP industry for more than a decade so I have quite some experience with this.

Large IP ranges are allocated as needed by IANA to each of the Regional Internet Registries.

The regions are generally continental in size - IP addresses are not assigned on a per-country basis.

The RIRs in turn then allocate IP addresses to ISPs, who in turn assign them to end-users.

Each of the RIRs maintain a whois server which can be queried to find out not only which ISP has been assigned any netblock, but to a certain extent which end-user, and that end-user's address.

Note that many ISPs do not fill out this information for every single customer. Hence if you're a residential subscriber of a DSL service, it's likely that the Geo records will give the address of your ISP, and not your own address.

The various GeoLocation providers mostly work by mining these whois records. Note that the legality of doing so is something of a gray area - RIPE's database copyright statement is here.

IANA also maintains the root zone for the DNS, but that is completely separate from any IP allocation functions. It is very important to maintain the distinction between domain name operations and IP addresses.

like image 120
Alnitak Avatar answered Oct 12 '22 14:10

Alnitak


To answer the specific question about "how it works": there's alot of manual labor involved, and the databases are to a large extent maintained manually. Just as other answers point out, there's no real correlation between IP ranges and countries, much less specific regions. Recently the system of IP address space distribution has been even more decentralized which means small private vendors can acquire IPv4 address ranges regardless of geographic region. This is why Google acquried Urchin so they could use their services for Google Analytics, which provides very accurate IP-to-geographic-region information.

If you don't want to use a service like MaxMind (free for personal use, and the database is open to some extent) or Google Analytics (free for personal use), there's free (and hence always slightly outdated) databases floating around, sometimes as flat files.

like image 26
bzlm Avatar answered Oct 12 '22 14:10

bzlm