Promoting a Secondary Server to Primary
How do I promote a secondary (sometimes called a "slave") server to primary (sometimes called a "master") if the current primary is offline too long?
- Make sure the expiry timer is sufficiently high, somewhere between multiple days and a month.
- For the zone definitions in
(a) Change the
masterand remove the
allow-transferstatements as appropriate.
(c) Possibly add
also-notifystatements as appropriate.
- Add key definitions if needed.
masterfile-format text;wasn't used in
named.conf.local, convert the zone files to text using
- If the server's name is different than the former primary, then the
SOArecord for each (to-be) primary zone must be updated. Since
rndcfreeze/thaw doesn't work on slave zones, the server probably needs to be shut down.
- Change the
SOArecord to the new server name.
Alternatively, you could try this method:
- Create an intermediary file that is a list of the zones needed to be able to quickly switch between primary and secondary.
- Use that file as data for a script (really different m4 macros) to create the proper configurations (at the same time) for both primary and secondary operating modes.
Each configuration is (effectively) stored in its own file:
- Dynamically update a sym-link to point to the operating mode of the server.
/etc/named/zones.conf -> /etc/named/zones.master.conf
/etc/named/zones.conf -> /etc/named/zones.slave.conf
named.conf file will then simply include the
(This article is based on an August, 2018 post on firstname.lastname@example.org, by Leroy Tennison, with some edits by ISC. )