I recently received a reply to my concerns about some DNS servers being slower than others despite all servers being anycast:
In practice, most resolvers won't be impacted by the slower paths to some of the name servers in the set. Most resolvers employ various techniques to provide fast lookups, such as preferring name servers that were previously seen to be faster, sending simultaneous queries to multiple name servers, or pre-fetching queries before the TTL has expired.
I was not aware that resolvers used these techniques and I was unsuccessful at searching for more info about this.
- Are there any names for these techniques?
- Which resolvers employ which of these techniques?
Unbound can prefetch almost-expired cache entries. If configured to do do, it does the following. If a client requests some name that is in the cache, but with less than 10% of its TTL left, then the client gets the answer immediately from cache, but unbound also sends a query upstream.
As for the other two techniques (caching response time and sending queries to multiple upstream servers), I don't know.
For server preferences based on latency look up "RTT banding".