Hacker News new | ask | show | jobs
by flangola7 1213 days ago
How do you make a domain point to different IP addresses depending on the user's network? I never understood how CDNs do this
2 comments

In addition to GeoDNS as explained by my sibling post, this can be achieved not by making the domain point to different IP addresses, but by placing multiple instances of the same IP address in different points in the network (Anycast), and which one you hit is determined by routing policy.

Some CDNs 'prefer' one approach or the other, e.g. Akamai tends to use DNS, CloudFlare tends to use Anycast, but these days most have the capability to do both or mix them as appropriate.

The dns server has multiple answers in the database and has logic to determine which one to respond with. Normally it’s based on the assume location of the client based on IP of the query but it need not be. “Geo DNS”