0

Ok,

Let's say I have 2 BIND servers (master & slave), the master fail's. The slave still answer to the queries... However, they do not have the zone files on the file system...

If I reboot the slave, will it still be aware about the content of the zones ?

Is there a procedure to rewrite the zone file on that slave and then I just change the config to make it the master ?

yield
  • 771
  • 1
  • 9
  • 24
  • how can a dns slave server not have the zone info? – natxo asenjo May 05 '16 at 13:44
  • @natxoasenjo You can have the zone data without storing it in a file. – Håkan Lindqvist May 05 '16 at 13:55
  • yes, but it must be available to the slave using ldap/sql. Otherwise it cannot serve any zones, right? ;-). So the OP must first explain (or understand) how his/her dns infrastructure is set up; then we can try to help him/her with the problems – natxo asenjo May 05 '16 at 13:58
  • 1
    @natxoasenjo It was available via `AXFR`/`IXFR` while the master was available. – Håkan Lindqvist May 05 '16 at 14:00
  • so it's still available when the master is not available. The fact that the master went offline does not mean it took the slaves' data with it, unless the data was in shared storage like a nfs share and the share went south (or north) – natxo asenjo May 05 '16 at 14:09
  • 1
    @natxoasenjo What the question says (and which is correct) is that if the slave only has the data in memory and the slave is restarted it would not be able to get the data again without the master. – Håkan Lindqvist May 05 '16 at 14:14
  • sorry, I see nothing about data in memory on the question. Your are assuming that it is so. What the OP says is: "they do not have the zone files", and provided OP says "I have 2 BIND servers" it's quite difficult to believe both the master and the slave have magically gotten the zone data somehow. It must come from somewhere :-) – natxo asenjo May 05 '16 at 15:51

1 Answers1

5

Provided that you specified a file in the definition of the slave zone (it's common practice to do so), the zone data will be stored in that file and will be available across restarts.

From the slave zone section of the manual:

If a file is specified, then the replica will be written to this file whenever the zone is changed, and reloaded from this file on a server restart. Use of a file is recommended, since it often speeds server startup and eliminates a needless waste of bandwidth.


However, it's worth noting that if the master is unavailable for an extended period of time the zone expiration timer will eventually come into play; the server with the slave zone will stop serving the zone after not being able to reach the master for the amount of time specified in the SOA EXPIRE field (usually weeks).


It is possible to change a slave zone to a master zone, but it's worth noting that modern BIND versions have different defaults for masterfile-format for master and slave zones (master zones are text, slave zones are raw), so your file may be in a different format than expected if you just switch type from slave to master.
Either override the masterfile-format setting or convert the zone file (eg named-compilezone -f raw example.com db.example.com).

Håkan Lindqvist
  • 35,011
  • 5
  • 69
  • 94