How does IP geolocation work?
GeoIP data providers combine regional Internet registry records (RIPE NCC, ARIN…), routing announcements, latency measurements and information supplied by network operators. Each address block is then mapped to a country, a region and often a city.