GeoDNS: Routing Users to the Nearest Region
What Is GeoDNS?
GeoDNS is a DNS technique where the same domain name resolves to different IP addresses depending on where the request comes from.
A user in Tokyo gets routed to your Tokyo servers. A user in Frankfurt gets routed to your Frankfurt servers. Same domain. Different IP. Zero application-layer logic required.
The Problem It Solves
Network latency increases with distance. The further a user is from your servers, the higher the round-trip time. For a user in Sydney connecting to a server in Virginia, you're looking at ~200ms of pure network latency before any application logic runs.
At scale, that adds up. Every page load, every API call, every WebSocket connection pays that latency tax.
GeoDNS eliminates it at the routing layer by directing users to the nearest region before a single byte of application traffic is exchanged.
How It Works
Standard DNS: your domain resolves to one IP address, always.
GeoDNS: the DNS server checks the IP address of the resolver making the request and returns the IP of the nearest region.
| 1 | User in Tokyo → DNS query for api.example.com → Returns: 35.xxx (Tokyo region) |
| 2 | User in London → DNS query for api.example.com → Returns: 18.xxx (EU region) |
The routing decision happens at DNS resolution time — before any HTTP connection is made. It's the cheapest possible routing: a different answer in the DNS response.
Note
When to Add It
Add GeoDNS when:
- You have servers or infrastructure in multiple regions
- You have global users — meaningful traffic from geographies far from your primary data center
- Latency is a product concern — real-time features, interactive UIs, APIs with tight SLAs
- You need region-level failover — if one region goes down, DNS can be updated to route traffic elsewhere
Rule of thumb
When NOT to Add It
- Single-region deployments — you only have servers in one place, GeoDNS doesn't help
- When a CDN already handles geographic distribution for your content
- Internal tools with users in one office or geography
Common mistake
GeoDNS vs CDN — The Difference
| GeoDNS | CDN | |
|---|---|---|
| What it does | Routes DNS to nearest region | Caches content at edge |
| What it handles | All traffic (API + static) | Primarily static assets |
| Latency benefit | Routes to right server | Serves from nearest cache node |
| Where decisions happen | DNS resolution | HTTP request level |
You typically use both together: GeoDNS routes dynamic API traffic to the nearest application server. The CDN handles static files and doesn't depend on GeoDNS at all.
Real World
AWS Route 53 offers latency-based routing — a form of GeoDNS that routes to the region with the lowest measured latency to the user, not just geographic proximity. Cloudflare does this automatically as part of their DNS service.
Companies like Spotify and Airbnb use multi-region deployments with GeoDNS to route users to the nearest application tier — EU traffic goes to EU servers, US traffic stays in the US. Latency drops by 150–200ms for global users.
Takeaways
- GeoDNS returns different IP addresses based on where the user's DNS query comes from
- Routes users to the nearest region at DNS resolution time — before any HTTP traffic
- Requires multiple regions to be useful
- Combine with CDN: GeoDNS for dynamic API traffic, CDN for static assets
- AWS Route 53 latency routing and Cloudflare both provide this out of the box
- Not a CDN replacement — different layers, different problems