Setup a forwarding caching-only DNS Server on Ubuntu
| 01-Feb-2008 | Posted by Sonia Hamilton under Cheatsheets, Networking, Ubuntu |
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
Share This
Most accurate and concise Bind cheatsheet I’ve found on the net. It simply works, thanks.
Thanks Nick! Sonia.
Awesome! It’s works great for me!
Thanks for the post!
You’re welcome Rana! Sonia.
One of the few, clear sources on how to make a caching/forwarding DNS at home.
Thank you, big time!
Hey Host Shot you’re welcome! :)