Networking and APIs / Advanced / 5 min / Updated
GeoDNS vs anycast: routing users to the nearest region
Serve India, Europe and the US from three regions, then take one down. GeoDNS waits for TTLs to expire; anycast moves traffic in seconds via BGP.
Start the simulation → Change the load, break a part, watch what happens. Free, no sign-up.
In short
What is geoDNS vs anycast?
GeoDNS returns a nearby region IP per user; anycast announces one IP from every region and lets BGP route.
Why does it matter?
Global users need low latency, and a failed region must not strand the users who were sent to it.
What is the trade-off?
GeoDNS is easy but failover waits for TTLs and sticky resolvers; anycast fails over fast but needs your own network.
How do you explain it in an interview?
"Anycast edge (CDN) in front, latency-based DNS to regions behind it, health checks with 60 s TTLs."
Check yourself
Why can GeoDNS failover take minutes?
Answer: Resolvers keep the old answer until its TTL expires, and some keep it longer. Failover time is roughly health check interval plus TTL, plus stragglers.
How does anycast send a user to the nearest site?
Answer: The same IP is announced from many places and internet routing picks the closest path. BGP chooses the shortest route to the announced prefix.
What is the trade-off of a very short DNS TTL?
Answer: Faster failover but many more DNS lookups, and some resolvers ignore it anyway. TTL trades failover speed for query load; it cannot force every resolver to comply.