How to fix slow Youtube when using OpenDNS
Posted in Wissen macht kluch on Februar 25th, 2010 by GrooveIf you are using OpenDNS (which I recommend) you may have noticed that loading Youtube Videos is really slow. That is because Youtube decides which Google Server farm delivers the Video to you based on your DNS Query. When your DNS Server resolves ytimg.com(where the Youtube videos are) it gets a IP-Address depending on its Location, so that all Users of the DNS Server load Youtube Videos from a Server near them. That works fine when you are using your ISP’s DNS Server, because it should be in the same Country as you are. But since OpenDNS does not have a Server in every Country, you can get a Youtube IP which is not so optimal for you. In my case I had to wait Minutes until the Video even started. And when it finally did it stopped frequently to buffer.
A Solution for this is to not use OpenDNS for all Youtube/Google Domains. That can be done with dnsmasq, which is very common on Linux Routers. Just add following lines to the dnsmasq configuration(/etc/dnsmasq.conf):
server=/google.com/8.8.8.8
server=/youtube.com/8.8.8.8
server=/ytimg.com/8.8.8.8
server=/google.de/8.8.8.8
server=/youtube.de/8.8.8.8
This tells dnsmasq to use the DNS Server 8.8.8.8 to resolve the listed Domains. 8.8.8.8 is Google’s own DNS Server, who better to give you the right IP Address. When you are using Google/Youtube Pages from other Country’s, just add them to the List.
But consider that an entry like /youtube./ is a bad idea. It would also work on something like youtube.baddomain.com and so bypass OpenDNS Security Features.
With that change Youtube Videos start nearly instantly for me again and don’t stop to buffer.
