OK, just took a look. Going to be fun....
Here's the 'v1' zip
wget
http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zipNow, that has a CSv file that seems to be in this format
Start IP - End IP - Two columns I think are the Decimal Start/Finish - Country Code - Country Name
e.g.
"1.0.0.0","1.0.0.255","16777216","16777471","AU","Australia"
"1.0.1.0","1.0.3.255","16777472","16778239","CN","China"
"1.0.4.0","1.0.7.255","16778240","16779263","AU","Australia"
"1.0.8.0","1.0.15.255","16779264","16781311","CN","China"
"1.0.16.0","1.0.31.255","16781312","16785407","JP","Japan"
"223.255.224.0","223.255.231.255","3758088192","3758090239","ID","Indonesia"
"223.255.232.0","223.255.235.255","3758090240","3758091263","AU","Australia"
"223.255.236.0","223.255.239.255","3758091264","3758092287","CN","China"
"223.255.240.0","223.255.243.255","3758092288","3758093311","HK","Hong Kong"
"223.255.244.0","223.255.247.255","3758093312","3758094335","IN","India"
"223.255.248.0","223.255.251.255","3758094336","3758095359","HK","Hong Kong"
"223.255.252.0","223.255.253.255","3758095360","3758095871","CN","China"
Now, the v2 DBs are trickier as they are split in to two files, one referrring to the other
network,geoname_id,registered_country_geoname_id,represented_country_geoname_id,is_anonymous_proxy,is_satellite_provider
1.0.0.0/24 2077456 2077456 0 0
1.0.1.0/24 1814991 1814991 0 0
The second file has a lookup for the geonam_id
geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_name,is_in_european_union
49518 en AF Africa RW Rwanda 0
51537 en AF Africa SO Somalia 0
69543 en AS Asia YE Yemen 0
It is perfectly possible to script something to meld the two together.
Just wondering of there is an easier way !
Any thoughts appreciated.