Technical
Where IP geolocation is accurate and where not
An IP address says which network a connection came from, not where the person is sitting. Geolocation databases guess a place for each address range, and the guess is good for some networks and poor for others. This post explains where those guesses come from, which situations bend them, and how to treat the fields our ip product returns.
Where a location comes from
Addresses are handed out in layers. IANA allocates blocks of IPv4 space to the five regional internet registries: APNIC, ARIN, RIPE NCC, AFRINIC and LACNIC 1. A registry then delegates ranges to network operators, who split them among customers. The registry record tells you which organization holds a range and usually a country of registration. It says nothing about a street.
A geolocation database starts from that ownership data and adds its own estimates for finer places. The publisher of the database we use states the limit plainly: its free Lite edition is a subset of the full database with reduced coverage and accuracy 2. Neither it nor the page we read publishes an accuracy percentage, so we do not quote one. Treat every city as an estimate with no stated error bar.
Why results vary
| Situation | What the address really identifies | Effect on the result |
|---|---|---|
| Fixed home or office line | The access network serving one site | Country is usually reliable. City may be the operator's hub rather than the building. |
| Mobile carrier | A carrier gateway that many phones share | The place can be wherever the carrier routes traffic, not where the phone is. |
| Carrier-grade NAT | One public address shared by many subscribers | A location describes the shared device, not any single user 3. |
| VPN or proxy | The exit server of the service | The place is the exit server, which can be in another country. |
| Cloud or hosting range | A server in a data center | The place is the data center. No person sits there. |
Situations that move or blur an IP location
Carrier-grade NAT lets several subscribers share one public IPv4 address. The RFC that reserved 100.64.0.0/10 for it lists, among the side effects, that geolocation systems may identify the NAT server rather than the end host 3. The same effect applies to any gateway that fronts many users.
Routing adds one more twist. An address block can move between operators, and a range can be announced from a different place than where its users are. A database built on a monthly snapshot will lag behind such changes, which is one more reason to read old results with care.
What our ip product returns
The product reads two open datasets from DB-IP: the City Lite database for place and the ASN Lite database for the network owner. Both are licensed CC BY 4.0, and the publisher requires credit to DB-IP, with a link back from web pages that display the results 2. Every response carries an attribution field with the credit text, and your pages that show the data should repeat it.
country: ISO 3166-1 alpha-2 code. The steadiest field.region,city,latitude,longitude: the database's estimate.timezoneis always null because the Lite source has no time zone field.asnandasn_org: the autonomous system number and the organization that holds it.is_hostingandhosting_provider: true when the address falls inside a cloud or hosting provider's published ranges.is_tor: true when the address is on the Tor Project exit list.is_vpnis always null, meaning unknown, never false.
Private, loopback, documentation and carrier-grade NAT ranges are not public addresses, so the product answers with an invalid-input error for them instead of inventing a place. A public address that no dataset covers returns not found.
curl -X POST https://YOUR_API_HOST/v1/ip \
-H "Authorization: Bearer $LOOKVALID_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ip":"8.8.8.8"}'
Look up one address
{
"ip": "8.8.8.8",
"country": "US",
"city": "Mountain View",
"timezone": null,
"asn": 15169,
"asn_org": "Google LLC",
"is_hosting": true,
"hosting_provider": "Google",
"is_vpn": null
}
Part of our captured example for 8.8.8.8
That address belongs to a hosting provider, so the city names a data center area. It is a good illustration of why is_hosting belongs next to the place whenever you read one.
Reading a result as a hint
- Use
countryfor coarse decisions such as default language or a currency suggestion, and let the visitor change it. - Show
cityonly as a soft label such as "near Mountain View", never as a fact about the person. - When
is_hostingoris_toris true, or theasn_orgis a known carrier, expect the place to describe infrastructure rather than the user. - Compare against a second signal, for example the billing country or the browser language, before acting on a mismatch.
- Do not ask the database for more than it can give. If a decision needs a real location, ask the person.
To wire the lookup into a server, see check an IP in Express middleware. To try a single address, use the free IP address lookup, and the ip product page lists every field.
Sources
- IANA IPv4 address space registry, read 2026-10-19
- DB-IP: free IP geolocation databases (Lite edition, license and attribution), read 2026-10-19
- RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space, read 2026-10-19