How does latency-based DNS routing choose an endpoint, and where can it go wrong?
Sketch your own answer first, then compare it with the one below.
A strong answer
The provider measures delay from regions to endpoints and answers each query with the endpoint that looks fastest for the asker's region.
The authoritative server sees the resolver, not the user. If a user is far from the resolver, the choice fits the resolver's location. The EDNS Client Subnet extension passes part of the client address to help, and not every resolver sends it.
Other problems follow. The table of delays goes stale, the answer is cached for the TTL, and the choice ignores load, so the nearest endpoint can be the one that is overloaded. Combine it with health checks and capacity limits.
Sources
- Paul Mockapetris (1987). RFC 1034: Domain Names, Concepts and Facilities.
- Paul Mockapetris (1987). RFC 1035: Domain Names, Implementation and Specification.