: How can I compile an IP address to country lookup database to make available for free? How would I go about compiling an accurate database of IP addresses and their related countries to make
How would I go about compiling an accurate database of IP addresses and their related countries to make available as an open source download for any web developer who wants to perform a geographic IP lookup?
It seems that a company called MaxMind has a monopoly on geographic IP data, because most online tutorials I've seen for country lookups based on IP addresses start by suggesting a subscription to MaxMind's paid service (or their less accurate free 'Lite' version, which requires a linkback and is updated once a month).
I'm not completely averse to paying for their solution or using the free one, but the concept of an accurate open source equivalent that anyone can use without restriction appeals to me, and I think it would be useful for the web development community.
How is geographic IP data collected, and how realistic is it to hope to maintain an up-to-date open version?
More posts by @Harper822
3 Comments
Sorted by latest first Latest Oldest Best
I compiled a small SQLite database from the data found over at (Oct 2011): www.maxmind.com/app/geolite
4.9MB 7zip file of the database can be downloaded from: db.tt/OSXRYfU0
Looks like pulling from the ARIN data like Nick suggested might be a better long-term solution.
After reading Christofian's answer, I did some research and found out that the five Regional Internet Registry members (APNIC, AFRINIC, ARIN, RIPE, and LACNIC) each maintain a copy of the allocated IP address ranges and the associated countries on their public FTP servers. This information is updated daily and mirrored between the five servers.
For example, to access the latest version of the IP address ranges and countries for the five regions as stored by the ARIN FTP server, you'd use these URLs:
ftp://ftp.arin.net/pub/stats/ripencc/delegated-ripencc-latest
ftp://ftp.arin.net/pub/stats/lacnic/delegated-lacnic-latest
ftp://ftp.arin.net/pub/stats/arin/delegated-arin-latest
ftp://ftp.arin.net/pub/stats/apnic/delegated-apnic-latest
ftp://ftp.arin.net/pub/stats/afrinic/delegated-afrinic-latest
The files contain records that look like this:
ripencc|GB|ipv4|195.242.236.0|1024|20040916|assigned
which corresponds to:
registry|cc|type|start|value|date|status
This is the Regional Internet Registry (RIR) Statistics Exchange Format standard, apparently, which is explained on APNIC's site here.
This should provide enough basic information to those interested to compile their own up-to-date databases programatically.
There is a free version of a GeoIP database available from Software77. In their FAQ page they say:
We cannot add or remove IPs from the database. The process we use is automated and the IPs in the database are as as we get them from the various registries around the world. If a registry does not list an IP the only way to get it in our database is for the registry to add it to their database.
They also release some updates, and at least for my usage the data was always correct.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.