1753500 Members
4469 Online
108794 Solutions
New Discussion

RHEL dns

 
MSwift
Regular Advisor

RHEL dns

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

Thanks

Mike
1 REPLY 1
Matti_Kurkela
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 1.2.3.4 and 5.6.7.8, add these lines to the "options {" section of the configuration file:

forwarders { 1.2.3.4; 5.6.7.8; };
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 127.0.0.1" or "dig @127.0.0.1" to make sure your caching DNS server works, then change the "nameserver" line(s) in /etc/resolv.conf to point to 127.0.0.1.
You're done!

MK
MK