Windows Server · How-To
How to Set Up DHCP on Windows Server
To run DHCP you install the DHCP Server role on a Windows Server that has a static IP address, complete the short post-install wizard, and — if the server is in an Active Directory domain — authorize it in the directory so it is allowed to hand out addresses. You then create a scope: a range of addresses to lease, plus the subnet mask, default gateway and DNS servers clients should use. Add exclusions for devices that use static addresses, add reservations for devices that need a fixed address, activate the scope, and confirm it works by checking address leases.
This guide walks through that end to end with general, version-safe steps. The menus and cmdlets below have been stable across recent Windows Server releases, so they apply whether you are on the latest Windows Server or a slightly older one in your environment.
Dynamic Host Configuration Protocol hands out IP addresses and network settings automatically. Instead of typing an address, mask, gateway and DNS server into every PC, phone and printer by hand, each device asks the DHCP server and is leased a complete configuration for a set period. One server can manage addressing for an entire network from a single console.
Before you begin: prerequisites
A DHCP server becomes responsible for addressing on your network, so get the basics right first:
- A supported Windows Server installation (Standard or Datacenter). A trial or evaluation build is fine for a lab.
- A static IP address on the server. A DHCP server must never get its own address from DHCP. Set a fixed IPv4 address, subnet mask, gateway and DNS on the network adapter before you install the role — a static IPv4 address is listed as a prerequisite in Microsoft's DHCP Server quickstart.
- A planned address range. Decide which addresses on your subnet DHCP will lease, and
which are reserved for servers and network gear. A common home or small-office example is the
192.168.1.0/24network with a mask of255.255.255.0. - Only one DHCP authority per range. If your router already runs DHCP for the same subnet, turn its DHCP off first. Two servers leasing the same range causes address conflicts.
- Rights to authorize (domain only). To authorize a DHCP server in Active Directory you need an account with permission to create the server object in the directory — typically a member of Enterprise Admins or someone with delegated rights over the NetServices container.
An active DHCP scope will start answering any client on its network segment. On a network that already has working DHCP — from a router or another server — a second server can hand out wrong addresses and break connectivity for everyone on that segment. Build and test on an isolated lab network or a segment you control, and only activate the scope once you are sure nothing else is serving the same range.
Step 1 — Install the DHCP Server role
You can do this with the graphical Server Manager or with one line of PowerShell.
Using Server Manager
- Open Server Manager and choose Manage → Add Roles and Features.
- Click through Before You Begin, keep Role-based or feature-based installation, and select your local server.
- On the Server Roles page, tick DHCP Server. When the pop-up offers to add the required management tools, click Add Features.
- Click Next through the remaining pages and then Install. No reboot is required for the role itself.
Using PowerShell
Open an elevated PowerShell window and run:
Install-WindowsFeature -Name DHCP -IncludeManagementTools
This installs the role and the DHCP management console and PowerShell module, and — as Microsoft's
Install-WindowsFeature reference
documents — -IncludeManagementTools is what pulls in those tools alongside the role itself. The
post-install configuration in the next step still has to be done separately.
Step 2 — Complete post-install and authorize in Active Directory
Installing the role does not finish the job. There is a short post-install step that creates the local security groups DHCP uses (DHCP Administrators and DHCP Users) and, in a domain, authorizes the server.
Using Server Manager
- After the install completes, look for the yellow notification flag near the top right of Server Manager. Click it and choose Complete DHCP configuration.
- The DHCP Post-Install Configuration Wizard opens. On the Authorization page, if this is a domain member, supply credentials that can authorize a DHCP server in Active Directory and choose Use the following user's credentials (or specify alternate credentials). On a workgroup server, choose Skip AD authorization.
- Click Commit, then Close. The wizard creates the two security groups and authorizes the server where applicable.
Using PowerShell
The equivalent commands create the security groups — Add-DhcpServerSecurityGroup is documented as adding the DHCP Users and DHCP Administrators groups — restart the service so they take effect, and authorize the server in the directory (replace the name and address with your server's):
Add-DhcpServerSecurityGroup
Restart-Service DHCPServer
Add-DhcpServerInDC -DnsName "dhcp01.corp.example.com" -IPAddress 192.168.1.10
You can confirm the server is authorized with Get-DhcpServerInDC, which lists every
authorized DHCP server in the domain.
In an Active Directory domain, an unauthorized DHCP server deliberately refuses to lease addresses — this is the built-in defence against rogue servers. If clients are not getting addresses and the server is in a domain, authorization is the first thing to check. A workgroup server has no directory to check against, so it serves as soon as it has an active scope.
Step 3 — Create a scope
A scope is the heart of a DHCP server: the pool of addresses it can lease, together with
the settings clients receive. Open the DHCP console from Server Manager
(Tools → DHCP) or run dhcpmgmt.msc.
- In the console tree, expand your server, right-click IPv4 and choose New Scope. Click Next in the wizard.
- Type a Name and description that make the scope's purpose clear, such as
Office LAN — 192.168.1.0. Click Next. - Set the IP Address Range: a Start IP address and End IP address for
the pool — for example
192.168.1.100to192.168.1.200— and the Subnet mask (for a/24network that is255.255.255.0). Every address in the range must be valid for your network and not otherwise in use. Click Next. - On the Add Exclusions and Delay page, enter any addresses inside the range that DHCP should not lease (see Step 4). You can skip this for now and add exclusions later. Click Next.
- Set the Lease Duration — how long a client keeps an address before it must renew. The default of 8 days suits stable wired networks; shorten it for guest or heavily mobile networks where devices come and go. Click Next.
- Choose Yes, I want to configure these options now to set the common client options, and click Next.
- Default gateway (Router): type the gateway address clients should use — usually your
router or firewall, for example
192.168.1.1— click Add, then Next. - DNS: type your Parent domain (for example
corp.example.com) and the DNS server addresses clients should use. In an Active Directory network these should be your domain controllers, not a router or public resolver. Click Add for each, then Next. - If you use a WINS server, add it here; most modern networks do not and can leave this blank. Click Next.
- Choose Yes, I want to activate this scope now and click Next, then Finish.
The scripted equivalent creates a scope and sets the gateway, DNS servers and DNS domain as scope-level options:
Add-DhcpServerv4Scope -Name "Office LAN" `
-StartRange 192.168.1.100 -EndRange 192.168.1.200 `
-SubnetMask 255.255.255.0 -State Active
Set-DhcpServerv4OptionValue -ScopeId 192.168.1.0 `
-Router 192.168.1.1 `
-DnsServer 192.168.1.10 -DnsDomain corp.example.com
Set an option at the scope level and it applies only to that scope; set it at the server level and it becomes the default for every scope on the server. DNS servers are a good candidate for server-level options when they are the same network-wide, while the default gateway usually belongs at scope level because it differs per subnet.
Step 4 — Add exclusions and reservations
Two features keep DHCP from clashing with fixed addresses and let you pin specific devices.
Exclusions — keep DHCP away from static addresses
An exclusion range is a block of addresses inside the scope that DHCP will never lease. Use it to protect addresses you have assigned by hand to servers, printers, access points or the gateway.
- In the DHCP console, expand the scope and select Address Pool.
- Right-click Address Pool and choose New Exclusion Range.
- Enter the Start IP address and End IP address to exclude — for a single address, put the same value in both fields — then click Add and Close.
From PowerShell:
Add-DhcpServerv4ExclusionRange -ScopeId 192.168.1.0 `
-StartRange 192.168.1.100 -EndRange 192.168.1.110
Reservations — a fixed address, still managed by DHCP
A reservation ties one address in the scope to a device's MAC address, so
that device always receives the same address from DHCP. This is the clean way to give a printer or server a
consistent address without hand-configuring it on the device. Find the device's MAC address on the device
itself, or on Windows with ipconfig /all (listed as the Physical Address).
- Expand the scope, right-click Reservations and choose New Reservation.
- Enter a Reservation name, the IP address to assign, and the device's MAC address.
- Leave Supported types at Both unless you have a reason to change it, click Add, then Close.
From PowerShell (MAC address written without separators or with hyphens):
Add-DhcpServerv4Reservation -ScopeId 192.168.1.0 `
-IPAddress 192.168.1.150 -ClientId AA-BB-CC-DD-EE-FF `
-Name "Reception-Printer"
A reserved address should sit inside the scope range — DHCP owns it and simply always gives it to the same device. An excluded address is one DHCP should never touch because something else already owns it. Mixing these up is a common cause of "why did two devices get the same address?" Use reservations for DHCP-managed devices and exclusions for statically configured ones.
Step 5 — Verify leases
With the scope active, confirm clients are actually getting addresses.
- On a client on the same network, open a command prompt and run
ipconfig /renewto request an address, thenipconfig /allto check the assigned address, subnet mask, gateway, DNS servers and the DHCP Server that issued the lease. - Back on the server, in the DHCP console expand the scope and open Address Leases. Each active client appears with its IP address, name, lease expiry and MAC address.
- Prefer PowerShell? List every lease in a scope with:
Get-DhcpServerv4Lease -ScopeId 192.168.1.0
To see how full a scope is, Get-DhcpServerv4ScopeStatistics -ScopeId 192.168.1.0 reports the
number of addresses in use and the percentage of the pool consumed — useful for spotting a scope that is
running out of room before clients start failing to get addresses.
Work through the usual suspects: the server has a static address; the scope is
active; in a domain the server is authorized
(Get-DhcpServerInDC); the DHCP Server service is running; and nothing else —
such as a router's built-in DHCP — is answering on the same segment. If server and clients sit on different
subnets, the router between them must forward DHCP with an IP helper / DHCP relay address,
because DHCP discovery broadcasts do not cross routers on their own.
Where to go next
Once a single scope is serving reliably, the natural next steps are to add scopes for other subnets, configure DHCP failover between two servers so addressing survives one server going offline, and review your lease duration and reservations as the network grows. If you have not yet built out the directory those DNS options point at, start with our companion guide on setting up Active Directory on Windows Server.
Frequently asked
Do I have to authorize the DHCP server in Active Directory?
If the server is a member of an Active Directory domain, yes. An unauthorized DHCP server in a domain will refuse to hand out leases, because Active Directory keeps a list of authorized servers to block rogue ones. You authorize it from the post-install wizard or from the DHCP console, using an account that can create the DHCP server object in the directory. A DHCP server in a workgroup, with no Active Directory to check against, does not need this and starts serving as soon as it has an active scope.
Should a DHCP server use a static IP address?
Yes. A DHCP server must have a fixed, manually configured IPv4 address before you install the role. It cannot hand out addresses reliably if its own address might change, and clients and other services need to reach it at a known address. Set the static address, subnet mask, gateway and DNS on the server's network adapter first, then install the DHCP Server role.
What is the difference between an exclusion and a reservation?
An exclusion range is a set of addresses inside the scope that DHCP will never lease to anyone, which you use to protect addresses assigned statically to servers, printers or the gateway. A reservation ties one specific address in the scope to one device's MAC address, so that device always gets the same address from DHCP while still being managed centrally. Use exclusions for devices configured by hand and reservations for devices you want DHCP to pin to a consistent address.
How do I check that clients are getting addresses?
In the DHCP console, expand the scope and open Address Leases to see every client that currently holds a lease, with its address, name and lease expiry. From PowerShell, run Get-DhcpServerv4Lease with the scope ID to list the same information. On a client you can run ipconfig /all to confirm it received an address from the correct DHCP server, or ipconfig /renew to force it to request one.
Browse all how-to guides for more Windows and Windows Server walkthroughs, or dig through the windows-now.com archive of restored community posts.