Deploying the DHCP Role on Windows Server: Scopes, Reservations and Failover

DHCP is one of those roles that everyone uses and few people configure deliberately. A default installation hands out addresses, but it also hands out your old DNS server, the wrong gateway, and a lease time that starves your subnet of free IPs. Whether the role runs on physical hardware or a Windows VPS acting as an internal network service, a properly planned scope is the difference between a network that quietly works and one that generates “why is my laptop offline” tickets every Monday.

This guide covers installing the DHCP Server role on Windows Server 2022 and 2025, designing scopes that do not waste addresses, choosing lease times that fit the client mix, and enabling failover so a single restart never takes the whole subnet down.

Installing the DHCP Server Role

Install through Server Manager’s Add Roles and Features wizard, or from PowerShell: Install-WindowsFeature -Name DHCP -IncludeManagementTools. On Server Core this is the only sane route, and the management tools give you the DhcpServer module so every subsequent step can be scripted.

After installation, complete the post-install configuration task that authorizes the server in Active Directory. An unauthorized DHCP server cannot issue leases in an AD environment and the service will not start, which is a deliberate safety feature — it stops someone plugging a rogue VM into the corporate subnet and handing out bad gateways.

Add-DhcpServerInDC -DnsName dhcp01.corp.local -IPAddress 10.0.0.10
# Security group for scope admins instead of Domain Admins
New-ADGroup -Name "DHCP Admins" -GroupScope Global -Path "OU=Groups,DC=corp,DC=local"
Add-DhcpServerSecurityGroup -ComputerName dhcp01

Note that Add-DhcpServerSecurityGroup creates the built-in DHCP Administrators group on the local server; add your operators to it and drop them from Domain Admins. Scope changes are routine operational work and should not require domain-wide privilege.

Designing scopes that do not waste addresses

A scope defines a contiguous range of addresses on one subnet. The common mistake is making the scope the entire subnet, which leaves no room for static assignments, printers or growth. Reserve the top and bottom of each subnet for infrastructure and keep the pool in the middle where it is easy to reason about.

For a /24, a clean layout is: .1–.20 for gateways, switches and firewalls; .21–.60 for statically assigned servers; .61–.240 as the dynamic pool; .241–.254 left free for future static needs. Anyone reading the scope configuration can then tell at a glance where a rogue static address belongs.

The DHCP server itself must have a static address inside the subnet it serves, or a relay must be configured on the router. On a VPS this catches people out: a multi-NIC VM often gets an address on one subnet only, and the second subnet needs a DHCP relay agent (or the server’s own NIC configured on that subnet) before clients there will see any offers.

Scope options: gateway, DNS and lease time

Set options at the server level only when they apply everywhere. Scope-level options override server-level ones, and that hierarchy is what lets you give a lab subnet a different gateway without touching production. Keep the DNS list short — two servers, both resolvable from the client subnet — and resist the temptation to add a public resolver as a third entry. Clients that fail over to 8.8.8.8 will bypass your internal DNS and break name resolution for internal resources in ways that are miserable to debug.

Lease duration follows the client mix. A desktop that never leaves the office can hold an eight-day lease. Laptops and phones that come and go should get something closer to eight hours, so stale addresses are recycled quickly. Wireless guest networks get the shortest leases of all, often one to two hours, because the churn is high and the address pool is small.

If you are running out of addresses despite the pool being large enough, check for duplicate leases handed to the same MAC by two servers, or for clients that never release. A quick audit is Get-DhcpServerv4ScopeStatistics, which reports free versus in-use percentages per scope and is the first thing to run before resizing anything.

Reservations versus exclusions

An exclusion removes an address or range from the pool entirely; nothing will ever hand it out. A reservation ties a specific MAC address to a specific IP and leaves the address available for that client only. Use exclusions for equipment you configure statically anyway — switches, hypervisor management interfaces, printers — and reservations for devices you want to keep on DHCP but pin to a known address, such as a label printer or a meeting-room display.

Do not build the whole server range from reservations. It looks tidy in the console and creates a pile of MAC bindings that break when a NIC is replaced, which is exactly the moment you have the least patience. Static configuration in the OS plus a matching exclusion is more honest and easier to document.

# Pin the office label printer without a static config
Add-DhcpServerv4Reservation -ScopeId 10.0.0.0 `
  -IPAddress 10.0.0.45 `
  -ClientId 00-1B-44-11-3A-B7 `
  -Description "Label printer - warehouse"

Enabling DHCP failover between two servers

Windows Server 2012 and later support native DHCP failover in two modes. Load balance runs both servers active and splits the address space by a percentage — typical for a single site where both servers are reachable. Hot standby keeps the secondary passive and takes over only when the primary stops responding, which suits a second site or a disaster-recovery node where you do not want leases issued from the far end under normal conditions.

Configure it from the primary with a single command, after the two servers have exchanged credentials through the failover wizard or a stored certificate:

Add-DhcpServerv4Failover -ComputerName dhcp01 `
  -PartnerServer dhcp02 `
  -Name "Corp-Primary" `
  -ScopeId 10.0.0.0 `
  -LoadBalancePercent 60 `
  -SharedSecret (Read-Host -AsSecureString)

Failover replicates the scope configuration and lease database. Important detail: the partner must have the scope defined and must be authorized in AD, otherwise the relationship cannot be established. After configuration, verify with Get-DhcpServerv4Failover that State is Normal on both sides, and confirm that a client can obtain a lease with the primary powered off. Do that test during business hours, not at 2 a.m. when you discover the secondary was never actually authorized.

Monitoring, backup and lease hygiene

Back up the DHCP database nightly with Backup-DhcpServer -Path D:\Backup\DHCP and copy it off the server. The database lives under C:\Windows\System32\dhcp and is not covered by a standard file backup if the service is running, so the cmdlet (which stops the service briefly) is the only correct way to snapshot it. Restore with Restore-DhcpServer on a freshly installed role.

Lease hygiene is mostly about auditing. Enable DHCP audit logging and point the log file at a path you actually read; the default file is DhcpSrvLog-Mon.log in System32 and it is written by a process running as LocalSystem, so it survives permission mistakes but is easy to forget. A monthly export of Get-DhcpServerv4Lease -ScopeId 10.0.0.0 to CSV gives you a baseline of which device owns which address, which is invaluable when a printer’s MAC changes and you need to know what it used to be.

Troubleshooting leases that will not hand out

Work through the layers in order. First, check the scope is activated — a scope can be created and left inactive, and it will appear in the console while handing out nothing. Second, confirm the server is authorized: Get-DhcpServerInDC should list it. Third, check the client and server are on the same broadcast domain, or that a relay exists. Fourth, look at the audit log for BAD_ADDRESS or DHCPDENY entries, which indicate address conflicts or a MAC filter doing its job.

A client stuck on 169.254.x.x is not receiving offers at all; a client with the right subnet but no internet usually has a gateway or DNS option problem rather than a DHCP one. Distinguish the two before you start changing scopes.

A deployment checklist

  • Static address on the DHCP server, inside or routed to every served subnet.
  • Role installed, authorized in AD, admin group scoped to operators.
  • Scopes laid out with reserved infrastructure ranges and a documented pool.
  • Options set at the narrowest scope that needs them; two DNS servers maximum.
  • Lease times tuned per client class, not one global default.
  • Nightly Backup-DhcpServer with an off-box copy and a tested restore.
  • Failover configured and failover actually tested.
  • Audit logging on, exported lease table kept for at least 90 days.

DHCP in a virtualized environment

Running DHCP on a VM adds two considerations. First, boot order: a hypervisor host that starts before its DHCP VM will hand out nothing while the management plane waits for addresses. Put the DHCP server on a static address on a management network and plug it into a separate power feed from the rest of the rack where possible. Second, snapshots: rolling a checkpoint back past a lease boundary restores an old lease database, and clients holding leases issued after the snapshot will look like conflicts. If you snapshot for update rollback, keep the window under the shortest lease duration you have configured.

For small sites on a Windows VPS, the role costs nothing extra, needs maybe 512 MB of RAM and a gigabyte of disk, and can be stood up in twenty minutes. The value is not in the installation; it is in laying out the scope before the first client appears and enabling failover the same day, because retrofitting either on a busy network is a scheduling problem nobody wants.

Leave a Comment