Wednesday, April 19, 2023

Anycast IP addresses and their use in DNS servers

What are Anycast IP addresses?
Multiple servers having the same IP addresses. The routers pick the closest server with the least BGP hops.

How are Anycast IP addresses implemented?
Anycast is simply that the same network is advertised from multiple places. A router receiving multiple advertisements for the same network will choose which advertisement to place in its routing table based on the metrics of the routing protocol. This results in the closest (from the perspective of the routing protocol metrics) destination being used by a router.

Why use Anycast IP addresses for DNS servers?
Excerpt from [1]:
With Unicast, DNS client resolvers can be configured with multiple DNS name server targets. In the event the resolver doesn't receive any response from the first server on the list, it will typically wait a time out value, before it switches to the second server (and subsequent servers) in the resolver list. The next time the resolver has to perform a look up, it won't "remember" servers in the list were non-responsive, and it will start querying with the first server in the list even though it is still unavailable.  Depending on the operating system of the client, it could be one to five seconds as it rotates through the resolver list each time, attempting the failed server.  

With anycast DNS IP addresses, this delay is eliminated and handled by the routing protocol.

References