Windows DHCP server: scopes, reservations and failover
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Core administration and security
-
Phase 3: Enterprise infrastructure
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
Nobody sits and types IP addresses into a thousand laptops. A Windows DHCP server gives each device its address, gateway and DNS servers as soon as it connects, and keeps a record of who has what.
You’ll install DHCP on SRV01 and authorise it in AD, build a scope with options, and move CL01 from its fixed address to DHCP with a reservation. Then you’ll add a failover partner so DHCP keeps running when one server goes down.
| Time | You need | By the end you can |
|---|---|---|
| About 75 minutes | DC01, DC02, SRV01 and CL01 from Lesson 13, and the DNS work from Lesson 14 | Install and authorise DHCP, create scopes, options, exclusions and reservations, set up failover, and fix “no address” and “no internet” problems |
What it is, in one line
A Windows DHCP server is the Windows Server role that hands out IP addresses and network settings to devices automatically, on loan for a set time called a lease.
In Simple Words
The hotel front desk
At a hotel, the front desk gives you a room number and tells you where breakfast is and how to call reception. You don’t pick a room yourself, which is why two guests never end up in the same one. The room is yours until checkout, you can extend at the desk if you stay longer, and regular guests can have “their” room kept for them every visit. DHCP is that front desk for your network: the room is the IP address, breakfast and reception are the gateway and DNS servers, checkout is the end of the lease and the regular’s room is a reservation.
Engineer's View
DORA, scopes, options and failover
DORA: the client broadcasts a Discover, servers reply with an Offer, the client broadcasts a Request for one of those offers and the server confirms it with an Acknowledge. All of this runs on UDP 67 (server) and 68 (client). The client first tries to renew at 50% of the lease, and tries again at 87.5%.
Scopes and options: a scope is the address range for one subnet, with exclusions for addresses you don’t want handed out and reservations that tie an address to a MAC address. Options carry the settings, such as 003 router, 006 DNS servers and 015 DNS domain name. You can set options at server, scope or reservation level, and the most specific one wins.
Authorisation: in a domain, a Windows DHCP server hands out addresses only if it’s listed in AD, which stops a test server from quietly taking over a network. Broadcasts don’t cross routers, so remote subnets need a DHCP relay (an “IP helper” on the router).
Failover: two servers share a scope’s lease data. In Load balance mode they split the work (50/50 by default), while Hot standby keeps one server in reserve. The partners sync leases over TCP 647, using a shared secret to authenticate.
How it works, step by step
This is the conversation CL01 has with SRV01 every time it needs an address:
Discover and Request are broadcasts, so every DHCP server on the subnet hears them. That’s where authorisation and failover come in: you want only the servers you planned to answer, and you want them to keep answering when one of them goes down.
This is the DHCP design you’ll build for LabNet:
- Install the role on SRV01 and create the DHCP security groups.
- Authorise SRV01 in AD.
- Create the scope 10.0.0.100 to 10.0.0.200 with router, DNS server and domain options.
- Move CL01 to DHCP and check its lease.
- Reserve an address for CL01.
- Add failover with DC02 in load-balance mode.
Hands-on Lab: Windows DHCP server on SRV01 with failover
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Start DC01, SRV01 and CL01. Sign in to SRV01 as SAATLAB\Administrator and open PowerShell as administrator.
1Install the DHCP role on SRV01
On SRV01, run this:
Install-WindowsFeature DHCP -IncludeManagementTools
Add-DhcpServerSecurityGroup
Restart-Service DHCPServerYou should see something like this:
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True No Success {DHCP Server, Remote Server Administration Tools, ...}Add-DhcpServerSecurityGroup creates the local groups DHCP Administrators and DHCP Users. If you used Server Manager, its post-install wizard would do this for you.
✅ Checkpoint: The DHCP Server role installed with Success and the DHCPServer service restarted.
2Authorise SRV01 in Active Directory
On SRV01, run this:
Add-DhcpServerInDC -DnsName SRV01.saatlab.internal -IPAddress 10.0.0.20
Get-DhcpServerInDC
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\ServerManager\Roles\12 -Name ConfigurationState -Value 2You should see something like this:
IPAddress DnsName
--------- -------
10.0.0.20 srv01.saatlab.internalThe last line tells Server Manager that setup is finished, which clears its yellow “complete DHCP configuration” flag. Authorisation is kept in AD’s configuration partition, so it applies to the whole forest.
✅ Checkpoint: Get-DhcpServerInDC lists SRV01 with 10.0.0.20.
3Create the LabNet scope and its options
On SRV01, run this:
Add-DhcpServerv4Scope -Name 'LabNet clients' -StartRange 10.0.0.100 -EndRange 10.0.0.200 -SubnetMask 255.255.255.0 -LeaseDuration 8.00:00:00 -State Active
Add-DhcpServerv4ExclusionRange -ScopeId 10.0.0.0 -StartRange 10.0.0.190 -EndRange 10.0.0.200
Set-DhcpServerv4OptionValue -ScopeId 10.0.0.0 -Router 10.0.0.1 -DnsServer 10.0.0.10, 10.0.0.11 -DnsDomain saatlab.internal
Get-DhcpServerv4Scope | Select-Object ScopeId, Name, StartRange, EndRange, LeaseDuration, State
Get-DhcpServerv4OptionValue -ScopeId 10.0.0.0 | Select-Object OptionId, Name, ValueYou should see something like this:
ScopeId Name StartRange EndRange LeaseDuration State
------- ---- ---------- -------- ------------- -----
10.0.0.0 LabNet clients 10.0.0.100 10.0.0.200 8.00:00:00 Active
OptionId Name Value
-------- ---- -----
51 Lease {691200}
15 DNS Domain Name {saatlab.internal}
6 DNS Servers {10.0.0.10, 10.0.0.11}
3 Router {10.0.0.1}Option 51 is the lease time in seconds (8 days). The exclusion stops DHCP from using 10.0.0.190 to 10.0.0.200, which you’ll keep for devices set up by hand later, like the printer in Lesson 18.
✅ Checkpoint: The scope is Active, and options 3, 6 and 15 show the gateway, both DCs and saatlab.internal.
4Move CL01 from its fixed address to DHCP
On CL01, open PowerShell as administrator (signed in as SAATLAB\Administrator):
Remove-NetIPAddress -InterfaceAlias Ethernet -AddressFamily IPv4 -Confirm:$false
Remove-NetRoute -InterfaceAlias Ethernet -DestinationPrefix 0.0.0.0/0 -Confirm:$false
Set-NetIPInterface -InterfaceAlias Ethernet -Dhcp Enabled
Set-DnsClientServerAddress -InterfaceAlias Ethernet -ResetServerAddresses
ipconfig /renew
(Get-NetIPAddress -InterfaceAlias Ethernet -AddressFamily IPv4).IPAddress
(Get-NetRoute -InterfaceAlias Ethernet -DestinationPrefix 0.0.0.0/0).NextHop
(Get-DnsClientServerAddress -InterfaceAlias Ethernet -AddressFamily IPv4).ServerAddressesYou should see something like this:
10.0.0.100
10.0.0.1
10.0.0.10
10.0.0.11Now look at the same lease from the server side, on SRV01:
Get-DhcpServerv4Lease -ScopeId 10.0.0.0 | Select-Object IPAddress, ClientId, HostName, AddressStateYou should see something like this:
IPAddress ClientId HostName AddressState
--------- -------- -------- ------------
10.0.0.100 08-00-27-3a-5c-91 CL01.saatlab.internal ActiveThe ClientId is CL01’s MAC address, and every VirtualBox adapter starts with 08-00-27. Note yours down, as you’ll need it in the next step.
✅ Checkpoint: CL01 has an address from 10.0.0.100 to 10.0.0.189, gateway 10.0.0.1 and both DCs as DNS servers.

5Give CL01 a reservation
On SRV01, run this with your own MAC address in it:
Add-DhcpServerv4Reservation -ScopeId 10.0.0.0 -IPAddress 10.0.0.150 -ClientId 08-00-27-3a-5c-91 -Name CL01 -Description 'Lab client'Then on CL01, release and renew:
ipconfig /release
ipconfig /renew
(Get-NetIPAddress -InterfaceAlias Ethernet -AddressFamily IPv4).IPAddressYou should see this:
10.0.0.150With a reservation, DHCP stays in central control and the device still gets a predictable address. That suits printers and some appliances, but servers and DCs should still have fixed addresses.
✅ Checkpoint: CL01 now has 10.0.0.150 from its reservation.
6Add DC02 as a failover partner
Shut down CL01 and start DC02. You’ll install DHCP on DC02 remotely, authorise it and then share the scope with it.
At work you’d often use another member server for this. If DHCP does run on a DC, set DNS update credentials with Set-DhcpServerDnsCredential so that its DNS updates don’t run as the DC itself.
Run this on SRV01, with a shared secret of your own:
Install-WindowsFeature DHCP -ComputerName DC02
Invoke-Command -ComputerName DC02 -ScriptBlock { Add-DhcpServerSecurityGroup; Restart-Service DHCPServer }
Add-DhcpServerInDC -DnsName DC02.saatlab.internal -IPAddress 10.0.0.11
Add-DhcpServerv4Failover -Name 'SRV01-DC02' -PartnerServer DC02.saatlab.internal -ScopeId 10.0.0.0 -LoadBalancePercent 50 -SharedSecret 'Lab-Failover-2026!'
Get-DhcpServerv4Failover | Select-Object Name, PartnerServer, Mode, LoadBalancePercent, StateYou should see something like this:
Name PartnerServer Mode LoadBalancePercent State
---- ------------- ---- ------------------ -----
SRV01-DC02 DC02.saatlab.internal LoadBalance 50 NormalDC02 now has the scope, its options and the reservation as well, and both servers know about every lease. If SRV01 goes down, DC02 carries on renewing and handing out addresses.
✅ Checkpoint: Failover shows Mode LoadBalance and State Normal, and Get-DhcpServerv4Scope -ComputerName DC02 shows the LabNet scope.
Finish by taking snapshots: shut down the VMs, then run this on your laptop:
'DC01','DC02','SRV01','CL01' | ForEach-Object { VBoxManage snapshot $_ take "DHCP ready" } Break It, Then Fix It
Start from the “DHCP ready” snapshots. You only need DC01, SRV01 and CL01 here, and DC02 should stay off so that SRV01 is the only DHCP server answering.
1Break it: a DHCP server that isn’t authorised
On SRV01, remove the authorisation and restart the service so it checks again:
Remove-DhcpServerInDC -DnsName SRV01.saatlab.internal -IPAddress 10.0.0.20
Restart-Service DHCPServerOn CL01, release the address and try to get a new one:
ipconfig /release
ipconfig /renewYou’ll get an error like this:
An error occurred while renewing interface Ethernet : unable to contact your DHCP server. Request has timed out.See what address CL01 gave itself:
(Get-NetIPAddress -InterfaceAlias Ethernet -AddressFamily IPv4).IPAddressYou should see something like this:
169.254.61.18A 169.254.x.x address (APIPA) is the client saying “I asked for DHCP and nobody answered”. On SRV01 you’ll find an event from DHCP-Server in the System log saying it isn’t authorised to serve clients, and it stays quiet until that changes.
To fix it, authorise again, restart and renew:
Add-DhcpServerInDC -DnsName SRV01.saatlab.internal -IPAddress 10.0.0.20 # on SRV01
Restart-Service DHCPServer # on SRV01
ipconfig /renew # on CL01✅ Checkpoint: CL01 got 169.254.x.x while SRV01 was unauthorised, and 10.0.0.150 again after the fix.

2Break it: the wrong router option
On SRV01, point the gateway option at an address nothing is using:
Set-DhcpServerv4OptionValue -ScopeId 10.0.0.0 -Router 10.0.0.254On CL01, renew and then test both the internet and an internal server:
ipconfig /renew
Test-NetConnection 1.1.1.1 -Port 443 | Select-Object RemoteAddress, TcpTestSucceeded
Test-NetConnection SRV01 -Port 445 | Select-Object RemoteAddress, TcpTestSucceededYou’ll see something like this:
WARNING: TCP connect to (1.1.1.1 : 443) failed
RemoteAddress TcpTestSucceeded
------------- ----------------
1.1.1.1 False
RemoteAddress TcpTestSucceeded
------------- ----------------
10.0.0.20 TrueCL01 has a valid address and can reach everything on its own subnet, but traffic for anywhere else goes to 10.0.0.254, which doesn’t exist. Whenever local works and the internet doesn’t, look at the gateway first.
To fix it, correct the option and renew:
Set-DhcpServerv4OptionValue -ScopeId 10.0.0.0 -Router 10.0.0.1 # on SRV01
ipconfig /renew # on CL01Clients only pick up option changes when they renew, and on a real network that happens over half the lease time, so a wrong option can take days to clear up everywhere. Check options carefully before you change them.
✅ Checkpoint: With 10.0.0.254 as the router, 1.1.1.1 failed and SRV01 worked; with 10.0.0.1, both work.
This happened at work
The Monday after the conference
A company hosted a two-day partner conference in its own building, and the visitors joined the guest Wi-Fi, which ran a /24 scope with the default 8-day lease. On Monday morning staff started calling the helpdesk because their phones and laptops on the same guest network couldn’t connect at all. Someone checked the scope and found it full. Two hundred visitors had gone home, but their leases still had six days left, so every address was “in use” by a device that was never coming back.
The team got people back online by deleting the visitors’ leases, and then fixed it properly with a 4-hour lease on the guest scope, a bigger subnet and an alert whenever Get-DhcpServerv4ScopeStatistics shows PercentageInUse above 80.
The lesson: set the lease time to match how long devices stay. Office desktops can have long leases, guests and busy Wi-Fi need short ones, and you should always keep an eye on how full your scopes are.
Common mistakes and troubleshooting
| Mistake or symptom | What happens | What to do instead |
|---|---|---|
| Client has 169.254.x.x | No DHCP server answered | Check the server is running, authorised, has unused addresses, and the relay on routed networks |
| Forgetting to authorise the server | It installs fine but leases nothing | Add-DhcpServerInDC, then restart the service |
| Wrong option 003 (router) | Local traffic works, internet and other subnets don’t | Check options with Get-DhcpServerv4OptionValue |
| Public DNS in option 006 | Clients can’t find DCs or sign in | Hand out only internal DNS servers |
| Long leases on guest or Wi-Fi scopes | The scope fills up with devices that left | Short leases there; monitor PercentageInUse |
| Scope overlaps fixed addresses | Address conflicts with servers or printers | Exclusions for fixed ranges, reservations for devices |
| One DHCP server, no failover | An outage stops new devices joining the network | Failover in load balance or hot standby mode |
| Clients on another subnet get nothing | Broadcasts don’t cross routers | Configure a DHCP relay (IP helper) on the router |
| Changing options and expecting instant effect | Clients update at renewal, up to half the lease later | Plan changes; ipconfig /renew for testing |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. Can you walk me through what happens when a laptop asks DHCP for an IP address?
Why they ask this: They want to know you understand how DHCP works underneath, beyond “it gives out addresses”.
How you might answer: It’s four messages, usually called DORA. The client sends a Discover, the server answers with an Offer, the client sends a Request for that address and the server confirms with an Acknowledge. From then on the client holds a lease on the address for a set time.
2. A user says the internet isn’t working, and you see their IP is 169.254.something. What does that tell you?
Why they ask this: They want to see that you can read this symptom straight away and know where to look next.
How you might answer: That’s an APIPA address, so the client asked for DHCP, got no answer and gave itself a link-local address. I’d check whether the DHCP server is up, then the network path, and the DHCP relay if the client is on another subnet.
3. What’s the difference between an exclusion and a reservation in a DHCP scope, and when would you use each?
Why they ask this: They want to know you understand the main scope features and use the right one for the job.
How you might answer: An exclusion is a range DHCP never hands out, like the addresses I’ve set statically on servers. A reservation always gives one particular address to one MAC address, so I’d use it for something like a printer that should keep the same IP but still be managed by DHCP.
2–5 years experience
4. You install the DHCP role on a new server, but it hands out nothing until you authorise it in AD. Why does Windows work that way?
Why they ask this: They want to see that you understand this safeguard and why it protects the network.
How you might answer: It’s there so a DHCP server installed by mistake can’t start handing out addresses on the company network, because a rogue DHCP server can take down a whole office. An unauthorised DHCP server that’s joined to the domain stays silent.
5. Your DHCP server sits in the data center, but clients are on a different subnet in another building. How do they still get addresses?
Why they ask this: They want to check that you know about DHCP relay, because DHCP broadcasts don’t cross routers by themselves.
How you might answer: The router acts as a DHCP relay, which you’ll also hear called an IP helper. It forwards the client’s broadcast to the DHCP server as unicast, and the server picks the scope that matches the relay’s address, so the client ends up with an IP from the right subnet.
6. You’re setting up DHCP failover. When would you pick load balance, and when would you pick hot standby?
Why they ask this: They want to see that you have designed failover and can match the mode to the situation.
How you might answer: Load balance shares clients between both servers, 50/50 by default, and I’d use it when both servers sit in the same place and are equally available. Hot standby keeps one server active and the other waiting with a reserved share of addresses, which works well for a central backup server covering several sites.
Senior level
7. Say a scope keeps running out of addresses every week. How would you find the cause and fix it for good?
Why they ask this: They want to see you look for the real cause instead of deleting leases and moving on.
How you might answer: I’d start with the scope statistics and lease history to see who’s holding the addresses, since it could be guests, rogue devices or a network loop. Then I’d shorten leases for devices that don’t stay long, or resize the subnet if it’s simply too small, and add monitoring and alerts so we hear about it before it fills up again.
8. How do DHCP and DNS work together in a Windows network, and what problems have you seen between them?
Why they ask this: They want to know if you understand dynamic updates and the common mess they can create.
How you might answer: DHCP can register A and PTR records for clients. The problems I’ve seen are stale records after leases expire, arguments over who owns a record, and DHCP running on a DC and registering records as the DC. I’d set DNS update credentials on DHCP and use secure updates.
9. You need to move DHCP from an old server to a new one, and users must not notice. How would you plan it?
Why they ask this: They want to see careful planning and a safe order of steps, with no gap in service.
How you might answer: I’d export everything with Export-DhcpServer and import it on the new server. Then I’d either set up failover between the two, or authorise the new one and deauthorise the old. After that I’d update the relay settings on the routers, check that leases are coming from the new server, and only then retire the old one.
Quick quiz
Q1. What does the R in DORA stand for?
- Release
- Request
- Renew
Show answer
B — The client requests one of the offers it received.
Q2. Why did SRV01 stop leasing in Break It step 1?
- The scope was full
- It was no longer authorised in AD
- CL01 had a reservation
Show answer
B — Unauthorised domain DHCP servers stay silent.
Q3. Which option tells clients their default gateway?
- 003 Router
- 006 DNS Servers
- 015 DNS Domain Name
Show answer
A — Option 003 is the router.
Q4. How does a client on another subnet reach the DHCP server?
- Through a DHCP relay on the router
- It can’t
- By using APIPA
Show answer
A — Relays forward the broadcasts.
Q5. In the work story, why did the guest scope fill up?
- A rogue DHCP server
- 8-day leases for visitors who had left
- A wrong router option
Show answer
B — Short leases suit short visits.
Quick recap
- A Windows DHCP server leases addresses using DORA; clients renew at 50% of the lease.
- Install the role, create the security groups, then authorise the server with
Add-DhcpServerInDC. - A scope has a range, exclusions, reservations and options (003 router, 006 DNS, 015 domain).
- 169.254.x.x means no DHCP answer; “local works, internet doesn’t” points at option 003.
- Failover shares a scope between two servers in load balance or hot standby mode.
- Match lease times to devices and watch
PercentageInUse.
Next lesson
Lesson 16: Disks, shares and NTFS permissions → You’ll add a data disk to SRV01, create shares for Finance and IT, set NTFS permissions with the AGDLP groups from Lesson 12, check effective access and turn on access-based enumeration.
Further reading: Windows DHCP server
Want to go deeper into Windows DHCP server? Microsoft’s DHCP in Windows Server pages cover scopes and options, and the DhcpServer PowerShell module lists every command used here. You can also see the full plan for this course on the Windows Server Administration course page.
