sonia hamilton – life on the digital bikepath – sonia@snowfrog.net

1 February 2008

Setup a forwarding caching-only DNS Server on Ubuntu

Filed under: Cheatsheets, Networking, Ubuntu — Sonia @ 14:02

A quick cheatsheet for setting up a forwarding, caching-only DNS Server on Ubuntu.

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

options {
directory "/var/cache/bind";

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

forwarders {
// forward requests to
1.2.3.4;
5.6.7.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 { 10.0.0.1; 127.0.0.1; };
};

Edit /etc/dhcp3/dhclient.conf, add the following lines:

# sonia: use this server's dns server first!!
interface "eth0" {
prepend domain-name-servers 127.0.0.1;
}

Finally, restart services and check work:

/etc/init.d/bind9 restart
netstat -tanp | grep named
grep bind /var/log/* | less
/etc/init.d/networking restart
cat /etc/resolv.conf

2 Comments »

  1. Most accurate and concise Bind cheatsheet I’ve found on the net. It simply works, thanks.

    Comment by Nick — 28 February 2009 @ 21:30

  2. Thanks Nick! Sonia.

    Comment by Sonia — 28 February 2009 @ 22:27


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.