All Emvero products use one prepaid credit balance. See how credits work

Start for free

GeoIP: country, city and distance

GeoIP adds location context to an address. Its estimate can disagree with the network path without establishing where the visitor is.

Published

On this page

A location associated with an address

GeoIP is the process of looking up an IP address in a database that associates network ranges with geographical information. The result may include a country, a city estimate and a time zone. The address itself contains no geographical coordinates.

This is useful context for a connection, but the result belongs to the visible address. A proxy exit, a mobile gateway and a home connection can all have location records whose relationship to the visitor differs. Start with IP addresses if the distinction between an address and a device is unfamiliar.

Where the location comes from

A provider may combine network registration information, operator submissions and other evidence. A geofeed lets a network operator publish an association between its prefixes and locations. RFC 8805 describes a coarse location format for those feeds. A published entry is a statement by its author, rather than a fresh measurement of every device using the range.

The country associated with a network’s registration can differ from the estimated country where an address is used. MaxMind’s database documentation distinguishes those fields and warns that coordinates must not identify a street address or household. An accuracy radius describes an area around an estimated point; the displayed point is not a visitor’s position.

Why the estimate can disagree with the path

Situation Why the record needs care
Mobile network A phone may reach the internet through a gateway far from the handset
Reassigned or moved address block A database can retain a location associated with earlier use
Proxy or VPN The visible address belongs to the exit, which can be remote from the visitor
Privacy relay The published location can describe the user’s broad region rather than the physical relay
Incomplete city record A representative point for a large area provides little basis for a distance comparison

Apple explicitly describes Private Relay addresses as preserving coarse user location. A nearby relay can therefore present an address associated with a more distant region. That disagreement can be expected behaviour for a privacy service.

Compare distance with timing cautiously

A location estimate becomes more informative when compared with an independently measured connection property. If the TCP endpoint responds far too quickly to be at the estimated location, there is a discrepancy to investigate.

The observer can calculate a geographical distance between its own position and the database’s estimated point. A corresponding round trip has a physical propagation cost, plus routing and processing delays. The actual cable route is generally longer than a straight line. Round-trip timings explains why the TCP endpoint can also differ from the browser behind an intermediary.

This comparison is asymmetric. A very short round trip can conflict with a distant location estimate. A long round trip is consistent with many causes: a distant endpoint, congestion, indirect routing or delayed processing. It does not confirm the city.

The inference also depends on where TCP terminates. Behind a load balancer, a measurement made by your origin server may describe the balancer rather than the external connection. A source-address header does not repair that difference.

What a discrepancy establishes

Suppose a database puts an exit in a distant region while a correctly measured TCP round trip suggests a nearby endpoint. The evidence says that the estimate and the measured path do not agree under the assumptions used. Plausible explanations include an intermediary, an outdated record or location information intended to represent the user’s region.

It does not establish that the visitor lied, that the device is near the server, or that the action is abusive. Several effects of the same intermediary can also appear together: a hosting ASN, a short TCP round trip and a location discrepancy may share one cause. Evidence statistics explains why counting them as independent evidence would exaggerate the result.

Keep the database context

Record which source and database release produced a location when the distinction matters to an investigation. Address assignments and provider records change. A lookup repeated today may answer a different question from a lookup performed when the connection arrived.

Read ASN and network categories for the network’s role, time zones for comparisons with browser settings, and residential and mobile proxies for intermediaries whose addresses resemble ordinary subscribers.