Content delivery networks and DNS

“Lisa needs braces!”
“Dental plan!”
“Lisa needs braces!”
“Dental plan!”
“Lisa needs braces!”
“Dental plan!”

I just had one of those moments when all the clues have been laid out before you, but it still takes you forever to put 2 and 2 together and get anything other than 2 and 2.

For the last six months, I’ve been railing against my crappy home Internet connection. That’s no surprise for anyone who lives in this country, but I just couldn’t believe that in 2010, I still couldn’t watch even a single Youtube video without having to pause, and come back in 10 minutes to watch it after it had buffered.

It turns out I had been shooting myself in the foot, or rather, they had been shooting me in the foot.

A while back, Google announced their DNS service.  It’s fantastic, because finally you didn’t have to look up your ISPs DNS server addresses every time you are setting up a computer on the net, and can just use Google’s easy-to-remember addresses of “8.8.8.8″ and “8.8.4.4″.  I started using it right away, because I was also moving between ISPs (from Xnet to Orcon) and it meant that things would change over smoothly. The only cost I thought would be that DNS lookups would have a slightly higher latency than if you used your local ISP’s servers.

However, it turns out there’s a bigger catch: content delivery networks use DNS requests to work out where in the world you are, and redirect you to their closest server. If you use a non-local DNS server Youtube, Akamai, and a whole bunch of others will send you all the way around the world to a far far away server when you are downloading stuff, instead of to a much closer (and usually faster) server. This is not what DNS is designed for, and it’s an ugly hack, but apparently it’s been going on for a while now, I just never worked it out.

This is stupid and annoying, and I can say that because one of the guys who helped create DNS thinks the same. The moral of the story though is that you can be better off using your local ISPs DNS servers instead of ones such as OpenDNS or Google Public DNS. At least under these circumstances.

2 thoughts on “Content delivery networks and DNS

  1. In theory, this is alleviated by having the google DNS servers be anycast. However, they don’t have one in NZ, so it doesn’t help us here. We end up hitting one in the States, so everything that does the annoying DNS stuff thinks you’re from there.

    You’ll find that this causes other problems too, even within the country. For example, when VPNed into work and using their DNS, I’m getting directed to things that use open WIX peering or are on Citylink. However, my actual connection is on TCL and they hate their customers, and don’t peer properly. This causes a number of sites to just not work. I haven’t worked out why they outright don’t work, as opposed to just being slow, but I haven’t looked too hard either.

  2. OpenDNS also says that if you use their servers, there isn’t a problem, but then they add, as an afterthought: “If you live in North America”. Thanks guys.

    I had never heard of Anycast, but it sounds like that would solve the problem completely, if only CDNs were using THAT instead of some dirty DNS hack.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>