Syed Jahanzaib Personal Blog to Share Knowledge !

July 4, 2011

Setup a forwarding caching-only DNS Server on Ubuntu

Filed under: Linux Related — Syed Jahanzaib / Pinochio~:) @ 9:05 AM

A quick cheat-sheet for setting up a forwarding, caching-only DNS Server on Ubuntu using BIND.

Edit /etc/bind/named.conf.options:

options {
directory “/var/cache/bind”;

// prevent firewall problems
query-source address * port 53;

forwarders {
// forward requests to
8.8.8.8;
221.132.112.8;
};

// don’t iterate
forward only;

// but DO cache (make it explicit)
recursion yes;

auth-nxdomain no; # conform to RFC1035

// don’t do IPv6
// listen-on-v6 { any; };
listen-on-v6 { none; };

// only listen on internal interfaces
listen-on { 192.168.2.1; 127.0.0.1; };
};
}

Finally, restart DNS services and check work:
/etc/init.d/bind9 restart
Also edit /etc/resolv.conf
and add at top
nameserver 127.0.0.1

%d bloggers like this: