How does geographic lookup by IP work?

Brian R. Bondy picture Brian R. Bondy · Nov 8, 2008 · Viewed 16.8k times · Source

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?

Answer

Alnitak picture Alnitak · Nov 10, 2008

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.