Promoting a Secondary Server to Primary
  • Updated on 21 Jan 2019
  • 1 minute to read
  • Contributors
  • Print
  • Share
  • Dark

Promoting a Secondary Server to Primary

  • Print
  • Share
  • Dark

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?

  1. Make sure the expiry timer is sufficiently high, somewhere between multiple days and a month.
  2. For the zone definitions in /etc/named.conf (or equivalent):
    (a) Change the type statements from slave to master and remove the masters statement.
    (b) Add allow-update and allow-transfer statements as appropriate.
    (c) Possibly add also-notify statements as appropriate.
  3. Add key definitions if needed.
  4. If masterfile-format text; wasn't used in named.conf.local, convert the zone files to text using named-compilezone including the -j parameter.
  5. If the server's name is different than the former primary, then the SOA record for each (to-be) primary zone must be updated. Since rndc freeze/thaw doesn't work on slave zones, the server probably needs to be shut down.
  6. Change the MNAME in the SOA record to the new server name.

Alternatively, you could try this method:

  1. Create an intermediary file that is a list of the zones needed to be able to quickly switch between primary and secondary.
  2. 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: /etc/named/zones.master.conf and /etc/named/zones.slave.conf.
  3. 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

The main named.conf file will then simply include the /etc/named/zones.conf file.

(This article is based on an August, 2018 post on, by Leroy Tennison, with some edits by ISC. )

Was this article helpful?