Forum Moderators: DixonJones
There are a ton of people who charge for this info, but the source information sources are all free (apnic, etc). is there anyone providing this database?
I do have a ip->country database already...
thanks!
The country code mapping is simple becuse the individual line from a registry's delegated list can be broken down simply:
ripencc¦IE¦ipv4¦193.29.52.0¦256¦20040330¦assigned
ripencc: is the IP registry.
IE: the country code for Ireland.
ipv4: An IPv4 address range
256: There are 256 addresses in this allocation 0-255
20040330: lastupdated on this date
assigned: assigned
The number of addresses can be larger than 256 and it frequently is at this level. The problem is where IP allocations are suballocated to individual users of the ISP/access providers. This is where the city stuff comes in because you have to dig deeper for every allocated IP. This generally involves access to the raw whois data and banging that data into a huge database. (From what I remember, the raw unprocessed data for the RIPE whois data is approximately 1G of text.) Then it is either a case of cross referencing the names of cities and towns over that database to produce something approaching an IP>city table.
It is a very complex task especially when you don't have ground-truth knowledge of the country you are trying to map. For example, Port Lairge and Waterford are the same city - Port Lairge is the Irish language name for the city. You've also got similar linguistic problems in some other multi-lingual European countries. Then there is the problem with outdated and incorrect data in the registry whois data.
Regards...jmcc