Geolocation: Determining the location of an IP address2>
You appear to be from Washington, District Of Columbia.
What is geolocation?
Geolocation is the pairing of IPs with geographical information to determine the IP location. For the past few years, this usually involved getting the country from an IP address. It can now include the city, as well.
How accurate is geolocation?
It depends on the database that you use. For countries, they are typically about 95+% accurate. For cities, accuracy can vary, typically ranging from about 50% to 80%. In many cases where the city is not correct, it is close to the correct city (such as a suburb of a major city). The accuracy isn't perfect, since there is no official source of the information, and IPs can sometimes be shared by people in different locations.
How can I get the city of visitors to my website?
We use a slightly modified version of the IP2Location database. They include information on how to use the database in ASP or PHP using SQL or MySQL. We found their accuracy to be very good, and their prices extremely competitive. Other companies selling geolocation databases include www.maxmind.com and www.geobytes.com.
What information can I get from an IP address?
Depending on the database you use, you can get the country, the region (state, province, etc.), and city. Plus, you may be able to get the latitude/longitude, ISP and domain name. Other information may include time zone, capital of the country, population, and/or currency of the country. In general, the more information you need, the more you have to pay.
How is geolocation done?
Determining the country from an IP is relatively easy -- the IP registrars supply the information for free. Whenever an IP range is allocated, it is allocated to an organization that needs to supply their country when they register.Determining the city from an IP is more difficult. One way would involve looking at all the IPWHOIS information for all IP ranges. This produces information that is not very accurate (an ISP covering an entire country may have all IPs registered to the same city), and may violate IPWHOIS agreements.
However, several organizations have found ways to more accurately determine the city of IP ranges. This is typically done by partnering with websites where users enter a city or ZIP/postal code (often when registering or ordering something). By looking at what IP ranges belong together, it is often possible to determine the city for IPs even if no information is known about that specific IP.
What is geolocation used for?
There are many uses for geolocation. One is just to be 'cool' -- people aren't used to seeing their city name on a web page. Another is to track where your users are coming from. Many smart merchants use geolocation as part of their fraud screening. If you have multiple local offices, you can point users to the correct one automatically. You could even target different people based on the demographics of the city that they are from. The uses of an IP location are endless.

