What is the difference between Anycast and GeoDNS / GeoIP wrt HA?

The key benefit of GeoDNS is that it resolves the same name to different IP addresses based on the requester's IP address.

An Anycasted DNS server will return the same IP address regardless of who is doing the asking.

The two work at different network layers. Anycast is below GeoDNS since it has no sense of the requester IP address's location, just its place in the network diagram. What may be close to the DNS server may not be close to the resource being requested, and the Anycasted DNS server has no way to tell this.

GeoDNS uses a map of resource locations and performs logic to determine which of those resources is closest to a given requesting IP address, and then returns that IP address.

Unless you're colocating your DNS servers with your network resources, what's close to the DNS server won't always be close to the resource, so using Anycast as your data-locality method is less effective than straight up GeoDNS.


The BGP anycast aspect lets clients send a request to a given DNS server, and get that request sent to a nearby instance of the DNS server by virtue of the BGP routing table, hopefully getting a quick response.

However, a normal ol' DNS server that's geographically distributed and anycasted does not have the capability of responding to queries differently depending on the requesting client's location - this is the extra feature that those "Geo-DNS" services are providing for extra cost, allowing you to send clients to an instance of a service that's close to them.

The reason for this feature to exist is that BGP anycast works just fine for something stateless like DNS, where it's quick and dirty and needs no connection or session persistence, but for something like a web server, you want to stick instances all over the world and make sure a given client will stick to a specific instance - routing changes in the global BGP table mid-connection would break TCP connections, break web application sessions, and generally cause havoc; anycast is generally not used for web servers for this reason.

It's best to provide a user in county X with an IP for an instance in country X via DNS, which is what you're forking the cash over for with a Geo-DNS service.


Traditionally, you will have multiple DNS servers. A client will pick one at random, and ask it for your web server's IP address. This is good if the DNS server is close to the client, but bad if - as is often the case - the DNS server is far away from the client. Either way, the client will get the same IP address as an answer.

Anycast lets multiple servers respond to the same IP address. With anycast DNS, when a client tries to talk to your nameserver, the closest/fastest nameserver responds. This means that the client always gets a fast response to his DNS query. However, he'll still always get the same answer to his DNS query - the IP of your server. If your server is far away from the client, the client experience may not be optimal.

GeoDNS lets a DNS server respond with a different IP address, depending on where the client is. (Obviously this requires you to have multiple geographically distributed servers.) GeoDNS doesn't imply anycast, although typically you'd deploy both, so that a client ends up getting his DNS query answered by a geographically nearby DNS server, which then replies with the IP address of a geographically nearby web server.