IP Location Lookup

If you are working closely with IP address, website or any , you might want to know where each visitors come from. The question is how to locate visitors. Let me take you to the very basic detail. What do you know about visitor right now? Well, what you know by now are just IP address of each visitor and referrer URL if specified. So the problem is how to lookup the location of given IP address.

There are many companies and orginzations provide this kind of database mapping IP addresses to country, city, autonomous number, network name, or even latitude/longitude. However, this information is very useful for us so they are mostly commercial product with annual subscription. I will not let you pay for it for sure. There are several free database for you anyway.

  1. IP-to-Country.com provides database in CSV format which is easily convertable to SQL script. Many projects use this database including PHP.net at least. For Drupal user, you might interest IP to Country module written by me. This database only provides mapping of IP address to country only.
  2. hostip.info provides very big database in SQL script (multiple tables). It contains city, country, and its latitude/longitude in detail so it is possible to locate the IP address in geo map or even using .

Generally, if your work don"t massively lookup the database, you be interesting in using web-based services offered by above database sites. In addition, if you don"t want the programmatic access to the database (read it yourself), you could try to use whois.

Post new comment