Skip to main content Skip to search
Ryan Neal
Posted by
Ryan Neal on
October 13, 2016

Netlify Leverages NS1 to Improve Performance Across 60,000+ Sites

There is no argument: site performance matters. Attrition can be measured in the milliseconds it takes a site to load. Shaving a mere moment off of load time can mean the difference between wildly popular and widely panned. Region specific routing, live monitoring and linked record type are the fuel for our global CDN. That’s why Netlify has paired with NS1 as our DNS provider - because for the creators of the 60,000+ sites on our platform, every millisecond counts.

Netlify is an automation platform for modern CDN based sites and apps, and runs multiple CDNs. Our own intelligent CDN stands at the core of Netlify, but we also utilize larger classic CDN providers (e.g. Akamai, Cloudfront). Needless to say, our DNS setup is anything but simple; in fact, our DNS layer practically needs to be alive. When a node has an error we need to be able to programmatically change the routes. We leverage NS1’s API to quickly fail nodes out of rotation and add them back when they repair themselves. Often, failures happen too quickly and subtly for a person to detect, let alone react. As we have a constant traffic load, we can't tolerate downtime. Using multiple monitoring services, in-house software, and NS1’s API, we strive for as many 9’s of uptime as possible.

We need the DNS layer to be location aware; a request from London should be routed to our PoP in Dublin, not Australia. This is a common feature of DNS providers, but maintaining the routing rules requires a lot of work. When we were using Dyn, we would have to manually configure these rules. It worked, but it often had problems. That’s because aside from manual configuration being cumbersome and error prone, we don’t follow shifting global traffic patterns as closely as a DNS provider would. With NS1, we just describe where we have our PoPs (15 and counting!) and rely on their service to do the Right™ thing. Using NS1 has significantly lowered the operational overhead and decreased our latency.

The linked record type NS1 offers definitely set them apart. Normally, a single A-record is set for the naked domain (e.g. Then CNAMEs are set for the other incantations of the site (e.g. This two-step lookup requires extra network time and can lose granularity on the origin of the request. As we looked into offering custom domains for our sites, we knew that NS1’s linked records would be invaluable. We register the domains with NS1 as our DNS provider and create a linked record to our global traffic director, completely removing the need for the second request. Because nobody wants to waste time on extra network requests, it was an obvious decision to use NS1.

The above times are dig queries for the site and The first is hosted on github pages and uses Fastly for its DNS provider. The second is a clone of the site hosted on Netlify while we were using DYN as a provider, and the third now that Netlify uses NS1. The numbers are the average of 10 samples over 2 minutes from each location, respectively.

The geographic origin of a request is important. It can affect how you route the request, which can, in turn, heavily affect the user experience. When using CNAMEs, the second request for the A-record is done by the DNS server automatically, which means the request looks like it is coming from the DNS server’s location, not the original client. This second-stage lookup could result in a sub-optimal IP for your location, but with NS1, that second-stage lookup is completely unnecessary. By keeping the geographic information intact we can remove some of the guesswork from traffic shaping.

NS1’s elegant API and responsive region-specific routing rules enable us to provide a much better SLA for uptime with graceful degradation. Couple that with the performance savings linked records allow us to pass along to our customers, and you can see why it only took us a millisecond to realize that switching to NS1 was the smartest choice Netlify could have made.

About the Author

Ryan Neal heads up metrics and infrastructure as part of the founding team of Netlify. He previously did the same for Yelp, and spent time with Palantir in the Middle East.

He resides in San Francisco and loves big data, whiskey and his golden retriever Sundance.

About Netlify

Netlify is SaaS platform that integrates and automates all the services needed to deploy and maintain modern CDN based sites and apps. (Server, CDN, Continuous Delivery, Prerendering, GEOip redirects and advanced proxying on CDN level, high cachability + instant cache invalidation + atomic deploys, HTTPS, custom domains, DNS panel and much more.)