Contact for queries :


  UpComing Live WebEx Workshop Series

SLAVE DNS server Configuration in Linux

A slave DNS server is similar to a master DNS server. It can help with load balancing and provide redundancy should the master DNS server fail. Because it serves as a “secondary” DNS server, it actually pulls the necessary files from its master counterpart, making configuration of a slave DNS server quite easy. Because the slave server pulls all the DNS records from the master, you need to set up the slave DNS server on RHEL02.

NOTE: On RHEL02, you need to install the BIND packages, make a backup of the /etc/named.conf file, and copy the following template.

When you have RHEL02 set up, you can use the following template for your /etc/named.conf file:

/* Global options for the BIND Server */
directory “/var/named”; // the default
dump-file “data/cache_dump.db”;
statistics-file “data/named_stats.txt”;
memstatistics-file “data/named_mem_stats.txt”;

/* Logging options so you know where your logs are going */
channel default_debug {
file “data/”;
severity dynamic;

/* Our sample domain is defined here */
zone “” {
type slave;
file “slaves/”;
masters {; };
/* This is a reverse lookup for our subnet */
zone “” {
type slave;
file “slaves/”;
masters {; };
/* File containing root hints (points directly to root DNS servers) */
zone “.” IN {
type hint;
file “named.root”;
/* The zone file for our localhost (good for troubleshooting) */
zone “localhost.” IN {
type master;
file “”;
allow-update { none; };
/* The reverse lookup zone for our localhost (again good for troubleshooting) */
zone “” IN {
type master;
file “named.local”;
allow-update { none; };

Because the slave server can provide redundancy or load balancing, its /etc/named.conf is similar to that of the master DNS server. The difference here, though, is that the slave server doesn’t actually need the zone files to exist.

You can see here that you define a masters option, which is actually the master DNS server. The slave DNS server will periodically check with the master DNS server, pull down the data for a zone, and create the zone file if it doesn’t exist. The slave zone files exist in the /var/named/slaves directory.

NOTE: Make sure that your, named.localhost, and named.loopback files are in place on RHEL02.

Step 1. With the files in place, you can check for syntax errors:

# service named configtest
zone localhost/IN: loaded serial 42
zone loaded serial 1997022700

Step 2. Start the named service:

# service named start
Starting named: [ OK ]

Step 3. Check the /var/named/slaves directory to see if the zone files copied over from the master DNS server correctly:

# ls /var/named/slaves

You can manually pull the zone files from the master DNS server by using the dig command to perform a zone transfer. We look at the full syntax of the dig command later, but here you can see how to manually transfer a zone file:

# dig -t axfr @rhel01
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> @rhel01 axfr
; (1 server found)
;; global options: printcmd 86400 IN SOA 2010120711 86400 7200 2419200 3600 86400 IN NS 86400 IN A 86400 IN A 86400 IN A 86400 IN A 86400 IN A 86400 IN SOA 2010120711 86400 7200 2419200 3600
;; Query time: 50 msec

;; WHEN: Tue Feb 1 10:21:25 2011
;; XFR size: 8 records (messages 1)

If you get any errors, the slave DNS server is not able to pull the zone files from the master DNS server until the errors are resolved. In the “DNS Utilities and Troubleshooting” section later, you see how to resolve any errors that are thrown here.

November 16, 2015

0 responses on "SLAVE DNS server Configuration in Linux"

Leave a Message

Your email address will not be published. Required fields are marked *


IGURKUL I.T. Training Hub offering various Career Certification courses in Computer Networking, Unix, Linux, Cloud Computing and DevOps Technologies. With its rich experience in IT training service sector, iGURKUL has been able to set Industry best practices in IT Training for the past five years.

In Past five years, more than 5000 professionals have been trained by iGURKUL for System administration, Cloud Computing and DevOps Skill set through our Online Training portal And , each day , more than 10000 working professionals from all over the globe visiting our knowledge base for the best practices and Knowledge learning.

copyright protected - 2011 © igurkul I.T. solutions. All rights reserved.