Caching-Only Server
The setup of a name caching-only server is a little different from what you have done already. The first thing we mentioned before starting any configuration is that you back up the original /etc/named.conf file (RHEL6 only). This original /etc/named.conf file is actually a sample named.conf file for name caching-only DNS servers! On RHEL01 again, make a backup of any current named.conf file:
# cp /etc/named.conf /etc/named.conf.bk
Restore the original named.conf file:
# mv /etc/named.conf.orig /etc/named.conf
Use the following as your caching-only nameserver /etc/named.conf config file:
/* General options for our caching-only name server */
options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;
memstatistics-file “/var/named/data/named_mem_stats.txt”;
allow-query { localhost; };
recursion yes;
};
/* Logging options so you know where your logs are going */
logging
{
channel default_debug {
file “data/named.run”;
severity dynamic;
};
};
/* This view statement forces cached lookups only */
zone “.” IN {
type hint;
file “named.ca”;
};
include “/etc/named.rfc1912.zones”;
Make sure to save this file as named.conf and ensure it is in the /etc/directory. For a caching-only nameserver, there is only one other file you need: /etc/named.rfc.1912.zones (as defined in the sample file). This file should already exist by default in the /etc directory.
MIGRATION TIP
The /etc/named.rfc.1912.zones file is put in the /etc directory when you
install the caching-nameserver package.
The named.rfc.1912.zones file looks for the named.localhost and named.loopback files created earlier. It also looks for a named.empty file, which should already exist in your /var/named directory.
MIGRATION TIP
The /etc/named.1912.zones file that is provided looks for different
filenames as pointed out in the “Master Server” section. Ensure that each
file referenced by the named.1912.zones file exists in /var/named;
otherwise, you get errors when you try to start the service.
Step 1. When you have everything set up, make sure that you test the config file for any errors:
# service named configtest
zone localhost/IN: loaded serial 42
zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Step 2. Now you can start the service:
# service named start
Starting named: [ OK ]
WARNING:
If you set up a caching-only nameserver, you should now switch your
/etc/named.conf file back to the master DNS server configuration.
The rest of this chapter deals with DNS security and troubleshooting
assuming that you still have the master DNS server in place.