GeoIP Lookup

Query geographic information for an explicit IP address through DNS or HTTPS.

Explicit Lookup Target

Every GeoIP query includes the IP address to look up. ResolveDB never substitutes the DNS or HTTP source address as the lookup target.

This makes the lookup independent of whether the client uses a recursive resolver, VPN, proxy, or direct DoH connection. A direct DoH connection still reveals its source IP to the HTTPS service in the ordinary way; the privacy property is that this source address is not used as the requested GeoIP value.

DNS Query

Use the geoip operation and an ip- label with IPv4 dots replaced by hyphens:

dig TXT geoip.ip-8-8-8-8.public.v1.resolvedb.net +short
v=rdb1;s=ok;t=data;e=plain;ip=8.8.8.8;cc=US;cn=United States;rg=California;ct=Mountain View;lat=37.386;lon=-122.084;tz=America/Los_Angeles;isp=Google LLC

HTTPS Queries

Use the JSON DNS endpoint:

curl --get https://doh.resolvedb.io/resolve \
  --data-urlencode "name=geoip.ip-8-8-8-8.public.v1.resolvedb.net" \
  --data-urlencode "type=TXT"

Or use the dedicated HTTP endpoint:

curl "https://doh.resolvedb.io/geoip?ip=8.8.8.8"

The dedicated endpoint returns ordinary JSON rather than the compact DNS field names:

{
  "ip": "8.8.8.8",
  "country": "United States",
  "country_code": "US",
  "region": "California",
  "city": "Mountain View",
  "latitude": 37.386,
  "longitude": -122.084,
  "timezone": "America/Los_Angeles",
  "isp": "Google LLC"
}

DNS Fields

FieldMeaning
ipExplicit IP address that was looked up
ccISO 3166-1 country code
cnCountry name
rgRegion or state
ctCity
latLatitude
lonLongitude
tzTime zone
ispNetwork or ISP name

Provider coverage varies. Optional location fields may be absent when the provider cannot determine them.

Private Addresses

Private, loopback, link-local, and unique-local addresses are identified without calling an external provider. They return a private-network response with a DNS TTL of 300 seconds.

dig TXT geoip.ip-192-168-1-100.public.v1.resolvedb.net +short
v=rdb1;s=ok;t=data;e=plain;ip=192.168.1.100;cc=--;cn=Private Network;isp=Private

Weather and sun services accept explicit cities, coordinates, IP addresses, and what3words labels:

dig TXT get.london.weather.public.v1.resolvedb.net +short
dig TXT get.51d5074_-0d1278.weather.public.v1.resolvedb.net +short
dig TXT get.ip-8-8-8-8.weather.public.v1.resolvedb.net +short
dig TXT get.w3w-filled-count-soap.weather.public.v1.resolvedb.net +short
dig TXT get.london.sun.public.v1.resolvedb.net +short

City, IP, and what3words resolution may call external providers. The same qname therefore identifies the same requested location, but upstream data can change.

Fleet Topology

ResolveDB has three unicast authoritative nameservers in NYC, SFO, and AMS. Recursive resolvers choose among the delegated nameservers; this is not an Anycast or guaranteed nearest-node routing system.

Guidance

  1. Always provide the IP or location explicitly.
  2. Use DoH or DoT when query confidentiality matters.
  3. Handle missing optional fields and provider failures.
  4. Treat the public RR TTL as a cache-lifetime directive, not a guarantee of source freshness.

Next Steps