One address, many servers
In anycast, the same IP address is announced from many locations at once. The internet routing system delivers each packet to whichever instance is closest by routing metrics, so users near each site reach a nearby server automatically.
Why DNS loves it
DNS is a near perfect fit for anycast because most queries are short and stateless, a single request and reply over UDP:
- Many physical servers share one advertised address, so resolvers need only one to configure.
- Routing steers each query to the nearest healthy instance, lowering latency.
- If one site fails, its route is withdrawn and traffic shifts to the next nearest site.
This gives both performance and resilience without the client knowing anything changed. The root and major public resolvers run on anycast for exactly these reasons.
The stateful caveat
Anycast works cleanly when each request stands alone. For long lived stateful sessions, a routing change mid connection could send packets to a different instance that has no state. Because DNS queries are tiny and independent, this caveat rarely bites it.
Key idea
Anycast advertises one DNS address from many sites, letting routing send each stateless query to the nearest healthy server while withdrawing failed sites automatically.