Knowledge Base ISC Main Website Ask a Question/Contact ISC
How do I resynchronize a failover pair?
Author: ISC Support Reference Number: AA-00609 Views: 7546 Created: 2012-01-26 09:00 Last Updated: 2017-08-01 21:06 0 Rating/ Voters

There are various reasons for wanting to resynchronize a failover pair of DHCP servers.  These include:

  • Hardware failure - one server is offline for a long time while it is replaced
  • Configuration error (changes or migrations) causing issues such as both servers believing that they are the primary for one or more address ranges
  • Migration

If the requirement is (for whatever reason) to manually trigger a re-synchronization, then assuming that the primary server is correct, on the secondary (or vice versa):

  1. Stop dhcpd
  2. Delete the leases file
  3. Create an empty leases file, such as the example in the dhcpd.leases(5) manual: # touch /var/state/dhcp/dhcpd.leases
  4. If the peer had been placed in partner-down state using OMAPI or through lease file editing, return the peer to normal state.
  5. Restart dhcpd.
This will cause the secondary to refresh the leases file entirely from the primary.  (This is sometimes called "faulting the database".)

This will not resolve any duplicate IP addresses

Incorrect configurations may cause two servers to assign the same lease to different clients.  Correcting the server configurations will not affect the clients who are already running with the same addresses.  If you have two clients with the same IP address, you need to find the one that was served by the secondary and cause it to request a new lease.  If you don't know which of the two clients obtained its lease from which server, then both will need to be made to request new addresses.

Use care if part of the lease database is not shared

You might not want to do this if the re-synchronizing server is serving one or more pools which is/are not shared with the peer.  Our best recommendation in such a case is to edit the leases file manually, or for a large server, use awk, perl or other scripting tool of choice to remove only the leases from the shared pool[s].

Use care if you have reserved leases in your leases file

Reserved leases are leases that are permanently assigned to one client who will always be granted this same lease and it will never be allocated to another client.  These are not specified in dhcpd.conf but are maintained solely in the leases file (usually created there via direct edit or OMAPI, or possibly by the dhcpd.conf infinite-is-reserved option).  Our best recommendation in such a case is to edit the leases file manually, or for a large server, use awk, perl or other scripting tool of choice to save and then restore the reserved leases before restarting the server whose lease database is to be 'faulted'.

© 2001-2018 Internet Systems Consortium

For assistance with problems and questions for which you have not been able to find an answer in our Knowledge Base, we recommend searching our community mailing list archives and/or posting your question there (you will need to register there first for your posts to be accepted). The bind-users and the dhcp-users lists particularly have a long-standing and active membership.

ISC relies on the financial support of the community to fund the development of its open source software products. If you would like to support future product evolution and maintenance as well having peace of mind knowing that our team of experts are poised to provide you with individual technical assistance whenever you call upon them, then please consider our Professional Subscription Support services - details can be found on our main website.

  • There is no feedback for this article
Quick Jump Menu