Saturday, April 10, 2010

Google DNS server

Now-a-days my airtel DSL connection's DNS servers fail to resolve some DNS addresses. I dont have an idea about what the problem is, but frequently I see many domains unable to be resolved and sometimes pretty slow too. So I decided to move to using the Google Open DNS Server. The IP is also a beautifully easy to remember - 8.8.8.8 . 8.8.4.4 is another DNS server of google which can be used as an alternate.

To keep this IP from being overwritten on my Fedora 12 Box, I figured out that the best way to do it would be to write a new file in /etc/NetworkManager/dispatcher.d/ which I names as 25-setdns with the following contents

#!/bin/sh
if [ "$2" = "up" ]; then
cp -f /etc/resolv.conf /etc/resolv.conf.BAK
echo nameserver 8.8.8.8 > /etc/resolv.conf
echo nameserver 8.8.4.4 >> /etc/resolv.conf
fi

This will ensure that the Google DNS will always be used to resolve my domain names.

Do note that I took a very crude, but simple approach here since I dont use any VPNs. If you do use VPN software, then you should make sure that the google DNS is the next entry. since your VPN's local DNS will resolve your VPN internal domains, which are unknown to outside world!

For the paranoid, this is yet more information you are pushing to google! :D

No comments: