Config for a slave server

choccarlm
choccarlm used Ask the Experts™
on
Hi,

I have 2 dns servers, lets say dns1.domain.com & dns2.domain.com. The way I've setup the dns servers is identical for both servers. I.E the named.conf file and the zone files are identical. I thought that the secondary dns server would still answer queries when the primary is down, but this isnt the case. Currently, the secondary dns server will only answer queries if the primary dns server is running.

I guess this is because I havent set the secondary dns server to be a slave, as I dont know the configuration to do it.

What I need to know is, how do I setup a named.conf file on a slave server and what do the zone files need to be like on a slave server?

I.E An entry in the named.conf file on the primary & secondary dns servers look like;

zone "testdomain.co.uk" {
    type master;
    file "named.testdomain.co.uk";
};

and the actual zone file looks like the following, on both servers;

$ORIGIN testdomain.co.uk.
@   IN SOA dns1.domain.com. hostmaster.testdomain.co.uk. (
                2002102801
                3600
                600
                604800
                3600 )
        IN NS   dns1.domain.com.
        IN NS   dns2.domain.com.
    IN MX   10  mail.domain.com.
www IN CNAME    web.domain.com.

Many thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Trying to tame bits. They're nasty.
Commented:
You should have somthing like
zone "testdomain.co.uk" {
   type master;
   file "named.testdomain.co.uk";
   allow-transfer {
           <IP of slave>;
   };
};

in the master server configuration, and
zone "testdomain.co.uk" {
   type slave;
   file "named.testdomain.co.uk";
   masters  {
          <IP of master>;
   };
};

in the slave configuration file.

Also in the option part of the master named.conf you can add
  notify on;  # guess what that does :)

delete the zone files (only those foe which this one is slave, don't delete the files for localhost and root servers) for the slave and restart bith servers.

In order for a machine to be able to use the secondary server, you have to specify both servers for that machine, either in resolv.conf (unix) or network..bla..bla for windows.

On unix, also have a look at /etc/nsswitch.conf, as this file configures the way a sistem will lookup for names

Author

Commented:
So if I setup the secondary name server correctly (slave server), this should answer requests even if the primary name server is down?

Also, will I need to setup the slave zone files, or will these be copied over when dns is restarted?

Thanks
Mihai BarbosTrying to tame bits. They're nasty.

Commented:
Both machine should answer no matter what the status of the other machine is.
With a correctly configured machines, the zone files should be replicated by the slave. That's why I've told you to delete those files. They should appear (by miracle:) when the slave starts.

You can use nslookup (use it in interactive mode) to check that servers are running.

I think that your problem is actually that either one server is not running, or the clients don't know about the second server, I don't think that the problem was that both were declared master. But it doesn't hurt to have a properly configured name service anyway
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Author

Commented:
I realised the problem because when I stopped the primary from running, I logged on to the secondary name server, and ran the ping command on a domain name that was in the named.conf file, and it couldnt ping it. I then started the primary again, and pinged from the secondary, and it worked.

Author

Commented:
Thanks a lot, that seems to be working

Cheers
Hi choccarlm and mbarbos ,

I'm new to DNS configuration , and am facing many problems while configuring it.

I'm facing the same problem that you were facing once. Can you pl. tell me more on , how you were able to correct your problem. In the above comments mbarbos  mentioned about the miracle of files getting replicated. I wanted to know, how the slave would replicate the zone files , when the primary DNS is down.

If possible suggest some sites, which will give me good overview and steps for DNS configuration.

eagerly waiting for ur replies.

Thanking You guys in advance.

Tejas.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial