Linux Fedora configure Caching Dns Server caching nameserver


Configure caching Dns Server (caching nameserver) on Fedora 15.


   The step by step below show how to configure caching dns server on Fedora system.  This step by step configuration of caching nameserver is done on Linux Fedora 15 system, please note that the configuration below may be a little bit vary from other Linux Fedora system.  The purpose of this caching dns server is to speed up dns query by querying local dns server (for local client on local network).. 


Install caching dns server on Linux Fedora:


1.  Log in on your Linux machine, and open an shell terminal.

2.  Then su - to make sure you have sufficient privileges to do some setup on the system.


[root@fedora ~]# su -


3.  Execute yum command below to install caching nameserver package on the system (more installation caching-nameserver).

[root@fedora ~]# yum update caching-nameserver


Step by step configure caching dns server on Linux Fedora:


   After successfully install caching nameserver package, start edit all the caching nameserver configuration file.


1.  Edit named configuration file, open and edit /etc/sysconfig/named configuration file using vi editor.


[root@fedora ~]# vi /etc/sysconfig/named


  -->  Make sure that this line exist, if not add this configuration line ROOTDIR="/var/named/chroot" in named file




  -->  .. see named configuration example


2.  Edit named.conf configuration file,  open and edit /etc/named.conf configuration file uisng vi editor.


[root@fedora ~]# vi /etc/named.conf


  -->  Change the configuration line below (that only allow your dns server only listen to loopback( address...)


                 listen-on port 53 {; };


                 listen-on port 53 { any; };


         This make sure that you allows your dns server to listen on all your server network IP Address.


  -->  and then change the configuration line below (that only allow query from your own machine...)


                 allow-query { localhost; };


                 allow-query { localhost;;; };

                 and add this line.....

                 recursion yes;

                 allow-recursion { localhost;;; };


                 This line is to make sure that localhost and your network client machine can query the dns server..


  -->  done... save and exit the editor (shift and ZZ).. see named.conf configuration example


3.  Restart your DNS server by issuing the following command.


  -->  for Fedora 15 restart command

[root@fedora ~]# systemctl restart named.service

  -->  or use (old version of Fedora)

[root@fedora ~]# service named restart


  -->  then issue command below to check named status...

[root@fedora ~]# systemctl status named.service

named.service - LSB: start|stop|status|restart|try-restart|reload|force-reload DNS server

          Loaded: loaded (/etc/rc.d/init.d/named)

          Active: active (running) since Sun, 31 Jul 2011 15:47:17 -0400; 6min ago

         Process: 29179 ExecStop=/etc/rc.d/init.d/named stop (code=exited, status=0/SUCCESS)

         Process: 29229 ExecStart=/etc/rc.d/init.d/named start (code=exited, status=0/SUCCESS)

        Main PID: 29262 (named)

          CGroup: name=systemd:/system/named.service

                  â 29262 /usr/sbin/named -u named -t /var/named/chroot

[root@fedora ~]#


4.  Test basic dns query to your dns server from your machine and your network client machine, by issuing one of the command example below


  -->  using dig

[root@fedora ~]# dig @

         or using nslookup

[root@fedora ~]# nslookup


         Make sure you replace the IP ( with your own dns cache nameserver IP Address.


5.  Now issue command below to make sure that our dns server starts automatically every time we boot up the server (named automatically start at boot time), issue command below.


  -->  for Fedora 15 automatic start command for dns (named) at boot time

[root@fedora ~]# systemctl enable named.service

  -->  or use for other Fedora

[root@fedora ~]# chkconfig 345 named on


6.  To make sure that your server and other Linux client query the newly setup server, edit your network / client network configuration and add this new dns server to the dns list.  On Fedora you may use NetworkManager to edit the dns setting and for Windows base user you may need to look into their Network Properties... note:- you may need to restart your network to apply the new configuration setting.


  -->  after applying the new configuration... verify by checking the resolv.conf to make sure that new dns server in the list

[root@fedora ~]# cat /etc/resolv.conf

# Generated by NetworkManager




[root@fedora ~]#


7.  Done...


Keywords:  fedora configure caching dns server, fedora configure caching nameserver, configure caching nameserver fedora 15, fedora 15 configure caching nameserver, linux fedora caching nameserver