This happens automatically, assuming that you’ve followed the DNS configuration best practices. When your DNS is setup reasonably, our ADN is designed to intelligently route your visitors to the ADN node nearest them on the network. This means that European visitors will load their site from a node in Europe, Australians from Australia, etc. The net result is less latency for your visitors when browsing your site.
But that’s not what you asked - you asked “How does it work?” If you want the lower-level details, our DNS provider is NS1 and we use their geographic routing feature to power our lookups. That article has the details about how the feature works, but the TL;DR is that the IP address returned from your DNS lookup will be one that is currently active and nearest to you. Our ADN also has some logic which makes sure that we only return nodes which are currently in operation, so in case a node is taken down for maintenance or otherwise misbehaves, traffic will not be sent to it.
In many locations, our ADN’s have more than one node, so you may see a variety of IP address responses if you repeatedly look up a correctly configured hostname:
$ host www.netlify.com www.netlify.com has address 184.108.40.206 www.netlify.com has IPv6 address 2604:a880:2:d0::21e9:c001 $ host www.netlify.com www.netlify.com has address 220.127.116.11 www.netlify.com has IPv6 address 2604:a880:2:d0::ddf:c001
Those two commands were run within 1 second of one another from the same location, and show two of our CDN nodes that were in rotation when the commands were run.
If you’re not sure about your DNS setup, the main thing to be sure of is that your custom domain (the “main name” you have set for the site) is not an “
A” record but instead a
CNAME if you don’t use our DNS hosting. If you do use our DNS hosting, it should be a “
NETLIFY” type record as shown in our UI.
Got questions? This thread is a great place to ask, but please include your hostname(s) including which is the custom domain so we can get you the best answers! That custom domain will be labeled as “primary domain” in your Domain Settings configuration in our UI.