How IP Geolocation Works: Inside GeoIP Databases
Where GeoIP data comes from, how accurate it is, why it updates weekly, and why your result is sometimes off by a whole province.
Look up an IP on IPchase and within milliseconds you get "China · Fujian · Ningde · China Unicom." Many people wonder: where does this data come from? How accurate is it? Why does it sometimes point to the neighboring province?
The Core Logic: A Map of IP Ranges
IP addresses are not registered device by device — they are allocated in blocks. IANA (the Internet Assigned Numbers Authority) hands address blocks to the regional registries (APNIC covers the Asia-Pacific), and registries allocate further to carriers and companies.
Every allocation record says: who this range was assigned to, and which city it was registered in. Aggregate the allocation data, the routing announcements, and real-world measurements, and you get a GeoIP database.
Under the hood the database is a prefix tree: a query for 1.2.4.8 walks down the binary prefixes, hits a node, and the node says "this range belongs to Ningde, Fujian."
The Major Data Sources
- MaxMind GeoLite2: the de facto standard. The community edition is free, city-level accuracy, updated weekly. It's what IPchase uses, deployed locally on our servers
- IP2Location / DB-IP: commercial databases, each with its own data corrections
- CZ88 (Chunzhen) IP database: a long-established Chinese database with solid supplementary coverage of mainland China
Accuracy: City Level Is the Ceiling, Not a Guarantee
Set expectations first: GeoIP's city-level accuracy runs roughly 70%–90%, and that's the ceiling.
The reason: IP registration records the carrier's registered address, not the user's physical location:
- An IP range assigned to a county town may be registered under the prefecture-level city branch
- Mobile traffic exits through provincial gateways, so users across the whole province look up as the provincial capital
- Anycast IPs on CDNs (like
8.8.8.8) are shared by dozens of nodes worldwide; the honest answer is "anycast"
So discrepancies like "it says Ningde but I'm in Fuzhou" are inherent to how the data works. Every GeoIP service has them — there is no such thing as an absolutely accurate database.
The Update Cycle: Why Weekly Refreshes Matter
Carriers keep reshuffling their ranges. MaxMind publishes a new GeoLite2 build every Tuesday, which includes:
- Newly allocated ranges
- Corrected ownership records
- ASN (autonomous system) changes
Let the database go stale and the consequences show: new ranges return blank, or ownership still points to the previous holder.
IPchase runs a local deployment on our own servers with daily automatic update checks — lookups depend on no external API, respond fast, have no query limits, and the database is pulled automatically whenever a new version ships.
What Else a Lookup Returns
A single IP lookup carries more metadata than most people expect:
| Field | Source | Purpose |
|---|---|---|
| Country/province/city | GeoIP City database | Displaying geolocation |
| Latitude/longitude | City database (city center point) | Map markers |
| Time zone | City database | Showing the local clock |
| ASN / carrier | GeoIP ASN database | Telling datacenter from residential |
| IP type | Datacenter/residential flags | Key to proxy detection |
ASN deserves special mention: AS4134 is the China Telecom backbone, AS15169 is Google — the ASN tells you whose network an IP belongs to. It's one of the core inputs for proxy detection.
Typical Cases of "Off by a Province" Results
Once you know the mechanism, the usual discrepancies all fall into place:
- Mobile traffic: exits are consolidated at provincial core gateways, so users across the province present the same city — the single largest source of "looked up as the provincial capital" results
- Newly provisioned broadband: registration lags behind newly activated ranges, so the GeoIP database may still show the previous holder's location
- Corporate lines: headquarters in Shanghai, branches using ranges registered to HQ — everyone looks up as Shanghai
- VPN / proxy: you're seeing the exit server's location, not yours — that's how proxies are supposed to work
- Satellite networks: for services like Starlink, the gateway station can be over a thousand kilometers from the user
To tell which case you've hit, look at the ASN: if it belongs to a mobile carrier (China Mobile, Vodafone, and the like), it's most likely gateway consolidation; if it belongs to a cloud or VPS provider (Alibaba Cloud, DigitalOcean), you're seeing the datacenter's location.
The Coordinates Are the City Center, Not Your House
The latitude and longitude a GeoIP City database returns are the coordinates of the registered city's center — the precision is the city itself. A point on the map two kilometers from your home is normal; two provinces off is also normal (a registration discrepancy).
Some commercial databases offer street-level positioning, but that comes from layering in WiFi positioning data, user reports, and other signals — no longer "pure IP geolocation." The ceiling for pure IP lookup is the city. Keep that in mind and you won't over-expect from any lookup service.
How to Cross-Check
To raise your confidence in a geolocation judgment, look at three kinds of signals together:
- GeoIP location — what the registration data says
- Time zone and language — whether the browser's time zone and system language match the geolocation (that's exactly what the disguise score test checks)
- Latency corroboration — use the Ping tool to measure RTT to the claimed city and see whether it's plausible for the physical distance: Singapore to Los Angeles has a physical floor of roughly 160ms, so a 40ms reading means the "Los Angeles" attribution is almost certainly wrong
Three signals corroborating each other beat any single database.
Summary
- IP geolocation = allocation records plus routing data; city-level accuracy of 70–90%
- Lookups are prefix matching against a local database, done in milliseconds
- The data changes weekly; when choosing a service, look at its update mechanism
- The ASN is the "clan" behind an IP — more informative than the city attribution
Try it: the IP lookup tool — enter any IP and see its full profile.
Check your own network: run a full disguise check on the homepage, or try the fingerprint test.