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;;

// 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 {;; };

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


  1. I have a linux mail server on that we have dns . The configuration has forwarders and forward only and also the root hint zone.
    My resolv.conf has nameserver and forwarders IP listed one by one.

    My question is how is the name resoluiotn done, when are the roothints used and when is the query forwarded.

    Comment by khaleel — August 9, 2011 @ 11:17 PM

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: