Combining two DHCP Servers, same scope

I  have two DHCP Servers on a /16 network. Running 2016. Both have the same scope, but different ranges of exclusions. Example:

DHCP1 - Scope 1 - For Distribution - excluded - excluded

DHCP2 - Scope 1 - for Distribution - excluded - excluded

So if you do the mental math there... it's quite messy. As a side note, in the actual environment there is about 30 different exclusions. As far as I can tell, they don't overlap... but it is quite confusing. I want to fix this!

What would be the best way to combine these two DHCP Servers in to one? I want to turn DHCP1 in to my primary, with DHCP2 in to a hot standby. But I want to try my best to not lose the reservations/leases already given out on DHCP2...

I tried a export/import, seeing if I could possibly just edit the export and combine both exports in to one, but it doesn't look like it is plain text.

Any ideas?
Who is Participating?
LucFEMEA Server EngineerCommented:
There are some steps involved, but it surely can be done.
Of course, someone else has already done it before. You can use the powershell script from:

In short what it does.
1) backup the servers and scopes
2) disable the scope on one server
3) copy leases (Get-DhcpServerv4Lease -ComputerName $sourceServer -ScopeId $scopeId | ? {$_.AddressState -notmatch "Reservation"} | Add-DhcpServerv4Lease -ComputerName $destinationServer -ScopeId $scopeId)
4) copy any reservations ($SourceServerReservations = Get-DhcpServerv4Reservation -ComputerName $sourceServer -ScopeId $scopeId | Add-DhcpServerv4Reservation -ComputerName $destinationServer -ScopeId $scopeId -ErrorAction SilentlyContinue)
5) delete the scope from the other server
6) create the failover relationship

Simply run it as
Migrate-DHCPFailover -ScopeId -SourceServer contdc02 -DestinationServer contdc01 -ExclusionRanges -SharedSecret Secret1

Open in new window

One thing I found in the script, it has no check if source & destination server are filled in with the same name. Make sure you don't accidentally type two times the same servername as it'll remove the scope from that server without migrating anything.
Cliff GaliherCommented:
There really is no good way to do this while preserving the leases. Just let them expire and get new leases. That's rather a major point behind DHCP. Otherwise, might as well just go static.
inTheKnowSeaAuthor Commented:
That's what I figured, but thought I would put a feeler out there if anyone had any ideas.

I did do some excel work and have identified all leases that don't exist on both servers, so if I really have to I can make those manually.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

nociSoftware EngineerCommented:
Two non-windows (ISC-)DHCP server could be  made to cooperate where both can handle ALL requests but only one will answer at a time.
Both will know the leases   Possibly windows DHCP could do the same?


man page:
Look for failover...
inTheKnowSeaAuthor Commented:
Windows definitely can, I got that part figured out. I am just trying to figure out the best way to get them in a state where I can set up that fail over without causing issues.
There is a lot of resources how to configure failover with load balancing for DHCP windows server 2012/2016.
DHCP Failover Load Balance Mode
Step by Step DHCP Failover in Windows Server 2016
Step-by-Step: Configure DHCP for Failover  Windows Server 2012
You can find also details in book MCSA Windows Server 2016 Complete Study Guide: Exam 70-740, Exam 70-741
nociSoftware EngineerCommented:
@inTheKnowSea: i don't mean by splitting scopes, i mean fully redundant. Where one will do the part of the other if that one fails.
inTheKnowSeaAuthor Commented:
So I just did a simple export of all leases on both servers. Did some excel work to find all leases on DHCP2 that did not exist on DHCP1. There wasn't many. From there I added the leases to DHCP1. Deleted everything on DHCP2, setup failover. Quick and easy.

Thanks for all the assistance.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.