Production ns1.example.com and ns2.example.com both point at one webserver combined with a DNS server for the same sites
Backup There is also an identical webserver and DNS combination which differs only by IP, and the fact that ns1.example.com and ns2.example.com do not point to it.
I now have two Debian VPS servers on separate providers which are intended for use as DNS servers. I don't get a massive amount of traffic so the DNS lookups should be fine on there.
ns1.example.com will be at one VPS server dns1, ns2.example.com will be at the other dns2.
The DNS on both of the VPS servers should be a copy of the production DNS, so that requests coming to dns1 and dns2 will be resolved directly to production. I wish to update the DNS from production to dns1 and dns2 regularly.
When the Production server is down (checked by regular cron from dns1&2, I can do this fine), I want to switch the DNS to that which is found on backup. The only difference between the two DNS server setups is that the one from backup has the IPs which relate to backup instead of those which relate to production.
I can't figure out how to transfer the DNS setup from production and backup onto dns1 and dns2. I have allowed zone transfers from those IP addresses; in fact I can do 'dig @ns1.example.com domain.com axfr' and see the contents of a single domain.
I've been looking for something like 'bind-export' or similar but can't find anything. How can this be done? I tried copying named.conf and zone files, but the structure seems entirely different between the two servers and I'm not sure what to do with that.
Every tutorial I can find on 'zone transfers' is about stopping them and not using them...
production and backup run PLESK. All four systems run BIND.