Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two VPS. I would like to use second one as a secondary dns server. both VPS are Debian 6. how I could do that? is it enough that I install bind9 and copy zone files from first VPS to second VPS?

share|improve this question
1  
What you want on VPS2 is called "slave mode". The slave server (VPS2) will AXFR the zones automatically from the master (VPS1). Search for "BIND slave". Notice that free secondary DNS services exist, and they can save you this setup and maintenance hassle. –  michele Jul 1 '12 at 12:00

1 Answer 1

up vote 4 down vote accepted

First of all if you want to setup a secondary DNS server you will need to define who is the master and the slave.

For example on the VPS1 server the master entry should like something like that:

zone "domain.com" IN {
   type master;
   file "master/domain.com";
   allow-transfer { VPS2_IP ;  };
};

On the VPS2 machine where you will run the slave DNS add this entries:

zone "domain.com" IN {
       type slave;
       file "domain.com";
       masters { VPS1_IP; };
};

Once you restart both DNS servers the slave server (VPS2) will automatically transfer the zone file from the master (VPS1).

You also need to change the zone file and add the new DNS server. Add a line like that

@    IN   NS    ns2.domain.com
ns2  IN   A     VP2_IP

Now the only thing left is to inform your domain registrar of the changes. Only after that your new NS will be public and used by clients.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.