makewhatis

Random Linux Garble.

Configure a Caching-only Name Server to Forward DNS Queries

To pass the RHCE one of the things that Red Hat wants you to setup is a caching-only name server. This is actually pretty easy with RHEL 6.

Install the bind package

sudo yum install bind

Then start the package and set it up to start on boot.

sudo /sbin/service named start && sudo /sbin/chkconfig named on

You have successfully setup the caching-only name server, for real. Now to get it to forward queries to a specific name server.

For me I just forwarded the queries to my local nameserver, the router on 192.168.1.1. To do this you edit named.conf

sudo vim /etc/named.conf

In the options section I added:

listen-on port 53  { 127.0.0.1; 192.168.1.101;};

;which is the ip for the bind dns server)

allow-query  { localhost; 192.168.1.0/24;};

; adding the ip block for localhost)

forward only;  
forwarders {192.168.1.1;};

This tells our bind server that I want to forward all dns queries to my router. I could also, for example, forward all queries to my ISP’s nameservers. In this case the ip would be 68.2.16.30 (ns1.ph.cox.net).

forwarders {68.2.16.30;};

Thats all there is to that requirement for the Red Hat Certified Engineer exam.