Being in Malaysia we are gifted with superior Internet speeds. NOT!!

Services like openDNS are awesome but the lag between us and them often results in sluggish performance anyways.

One way to improve performance is to use local DNS servers. I don’t use Streamyx’s DNS servers because they SUCK!!. TIME’s DNS servers are ok but I still prefer openDNS.

To improve performance, I put together a local DNS caching-only server that forwards to openDNS. Now I have openDNS with lighting fast response.

Let’s walk though the steps to get your own local DNS caching-only server setup. I’m using openSUSE 11 so the steps might vary depending on your distro.

  1. Install BIND

pandora:~ # zypper in bind

  1. Edit /etc/named.conf

pandora:~ # vi /etc/named..conf

Uncomment the forwarders section. Update the default values with the values below.

forwarders { 208.67.222.222; 208.67.220.220; };
<br /> forward only;

Add the line " forward only; " This will tell BIND to only forward to the forwarders and not the ROOT servers.

  1. Start the service.

To have the service start automatically run " chkconfig named on "

pandora:~ # service named start

  1. Let’s make sure your caching server is running fine.

pandora:~ # nslookup google.com localhost<br /> Server:         localhost<br /> Address:        127.0.0.1#53

Non-authoritative answer:<br /> Name:   google.com<br /> Address: 64.233.167.99<br /> Name:   google.com<br /> Address: 72.14.207.99<br /> Name:   google.com<br /> Address: 64.233.187.99
<br /> pandora:~ # nslookup yahoo.com localhost<br /> Server:         localhost<br /> Address:        127.0.0.1#53

Non-authoritative answer:<br /> Name:   yahoo.com<br /> Address: 68.180.206.184<br /> Name:   yahoo.com<br /> Address: 206.190.60.37

  1. Update your /etc/resolv.conf file.

This will tell your system to use the local DNS server which we just setup instead of the external ones.

Add the lines below to the file.

nameserver 127.0.0.1<br /> nameserver 127.0.0.2

That’s it. You now have local DNS caching. Enjoy!!

My /etc/named.conf file. Only the lines I changed.

#forwarders { 192.0.2.1; 192.0.2.2; };<br /> forwarders { 208.67.222.222; 208.67.220.220; };

# Enable the next entry to prefer usage of the name server declared in
# the forwarders section.

#forward first;
forward only;