bind master slave. What if MASTER dies

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 ?


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).