CDN routing algorithms

This is more a question curiosity than a technical issue, as everything works well with our websites.

Have been doing some checks via Perf-Test, which does CDN checks from various locales around the planet. It seems most routes are the shorter option except Canada, as Calgary gets routed to Charleston SC every time, yet there is a POP in Oregon and another in California.

Just to make sure it wasn’t coincidence, I have run the test numerous times on different days. The test point in southern California always gets routed to a west coast POP, the New Jersey test point to an east coast POP, but Calgary always goes cross country to South Carolina the furthest POP away.

On a bright ending note, all the connections around the world show decent ping times, except South Africa which gets routed to Sao Paulo.

To start with the easy one, I can explain the South Africa behavior.

There is a cross ocean fiber-optic cable between Brazil and South Africa. While they may not appear to be geographically close, in the network topology they are close. Those really are the “closest” CDN nodes to South Africa ("closest on the network and not by geography).

Now, the Calgary routing to the east coast is odd though. To troubleshoot this some additional details are required and I’m unsure if you will have access to the information or not. If possible, would you please send us the following details?

  • the client IP address making the DNS query
  • the IP address of the DNS resolver used
  • the domain name the DNS query is for

With those details we can research this to find out why this is happening.

If you are curious about the technical implementation this feature, the first detail to answer is that our DNS infrastructure is built using NS1. NS1 is a DNS IaaS (Infrastructure as a Service) company. Many companies that provide web hosting service use NS1 for DNS infrastructure - Netlify included. It is the geographic routing feature at NS1 that enables the geographical routing via DNS.

To summarize, we can troubleshoot the Calgary routing issue with some more information. If you send us those details, we’ll let you know what we find. If there are any questions, please let us know.

1 Like

Sorry, but I don’t think I have access to all the details you need. The PerfTest service is an online service and all they give you are CDN locations they were directed to and ping times from their various test sites (city names only for test sites).

The domain name I was testing was our bicycle touring website: Our DNS is through Constellix, with the ANAME record pointing to

I punched your domain in (the main and it also got bounced cross country from Calgary, though yours went to Virginia a couple of times and to South Carolina a couple of times.

Hi, @mrcycling. Without the information required to troubleshoot I can guess only. I’ll still give you my best guesses but that is all I can do without the required troubleshooting information.

My best guess is that the tests from Calgary are using a DNS resolver elsewhere. As this resolver IP address will be IP address seen by our DNS system, we will return the closest IP address to the resolver, not the closet to the system itself.

Another possibility (but this doesn’t seem likely to me) is that the network distance is closet to the eat coast similar to how Brazil and South Africa are not close geographically but are close measured by network hops or communication delays. I see the Rockies to the west so maybe that is contributing to the issue and making eastward routes shorter from a network perspective.

However, Virginia is so far away this seems unlikely and a non-local DNS resolver seems more probable to me.

If there are other questions about this, please let us know.