Showing results for 
Search instead for 
Did you mean: 

RHEL dns

Regular Advisor

RHEL dns

How would you implement a dns as a cachee instance running local on a server to avoid huge dns lookups?


Honored Contributor

Re: RHEL dns

On RHEL 5 and newer, by running "yum install caching-nameserver". This will give you the BIND name server daemon with an example configuration as "/etc/named.caching-nameserver.conf".

Copy the example configuration to /etc/named.conf. If you don't want (or aren't allowed) to use Internet root nameservers directly, you should add a few options to the configuration file to define the local nameservers your caching DNS server will use to get the data that is not already in the cache. For example, if your site's DNS servers are and, add these lines to the "options {" section of the configuration file:

forwarders {;; };
forward only;

If you want to try the configured forwarders first, but fall back to contacting the Internet nameservers directly if the forwarder servers aren't responding, replace "forward only" with "forward first".

After creating your /etc/named.conf, run:

chkconfig named on
service named start

Use "nslookup" or "dig @" to make sure your caching DNS server works, then change the "nameserver" line(s) in /etc/resolv.conf to point to
You're done!