DEV Community

Vitalii Shumylo
Vitalii Shumylo

Posted on Originally published at learnitlessons.com

DHCP failover is up, but only half the clients see your new setting

You have two Windows DHCP servers in a failover relationship. You add a reservation or change a scope option, such as the DNS server, on one of them. After that, some clients get the new value and others keep the old one. It looks random.

It is not random. In load balance mode, both servers answer clients at the same time. A hash of the client's MAC address decides which server replies, so each server looks after about half of the clients. The two partners keep their lease records in step without your help. Scope settings are a different matter: they stay on the server where you made the change. So only the clients of that server get it.

The fix is to replicate the relationship after every change. Start it from the server that holds the correct settings, because replication overwrites the configuration on the partner. Then read the value back from the partner:

Invoke-DhcpServerv4FailoverReplication -ComputerName DHCP1 -Name 'DHCP1-DHCP2'
Get-DhcpServerv4Reservation -ComputerName DHCP2 -ScopeId 10.10.10.0
Enter fullscreen mode Exit fullscreen mode

For a scope option, use Get-DhcpServerv4OptionValue with the same -ComputerName and -ScopeId values instead.

The full guide starts earlier. It helps you choose between load balance and hot standby, and it lists the checks to make first, such as the clock difference and TCP port 647. It creates the relationship with one command and confirms that the state is Normal. Then it stops one server and renews a client to prove that failover really works. It also explains why a hot standby server can stop giving new addresses, and how to let it use the whole pool.

Read the full guide: https://learnitlessons.com/articles/dhcp-failover-windows-server/

Written with AI assistance and checked by the author.

Top comments (0)