Windows Server DNS and DHCP Explained for Beginners
Azure·December 3, 2026·6 min read

Windows Server DNS and DHCP Explained for Beginners

Plug a laptop into an office network and two things happen in the first few seconds. Something gives it an IP address, and something lets it find fileserver by name instead of by number. On a Windows network, those two jobs usually belong to two server roles: DHCP and DNS.

If you want the basics of DNS lookups and record types first, read What Is DNS and How Does It Work in Azure?. This post focuses on running both services yourself on Windows Server.

Two Jobs: Handing Out Addresses and Finding Names

Think of a hotel. The front desk hands each guest a room key and tells them where breakfast is served. The guest directory lets anyone look up which room a person is in.

DHCP is the front desk. It leases each device an IP address, plus the settings it needs to use the network, such as the default gateway and which DNS server to ask. DNS is the directory. It maps names to addresses, and addresses back to names.

The two roles connect through one setting: the DHCP scope tells every client which DNS server to use. That's why they're so often installed together:

Install-WindowsFeature -Name DNS -IncludeManagementTools
Install-WindowsFeature -Name DHCP -IncludeManagementTools

The DNS Server Role: Zones You Own

A DNS server holds its records in zones. A zone is the set of names the server is responsible for answering, such as everything ending in cloudlearn.local.

Windows Server DNS uses two kinds of zones:

  • A forward lookup zone answers "what is the IP for this name?" It holds A records (name to IPv4 address), CNAME records (an alias for another name), and MX records (where email for the domain goes).
  • A reverse lookup zone answers the opposite question, "what name owns this IP?" It holds PTR records. For the 10.0.1.0/24 network the zone is named 1.0.10.in-addr.arpa, the network address written backwards. Mail servers and logging tools rely on reverse lookups more than you'd expect.

Zones can live in a file on the server or, on a domain controller, inside Active Directory. For names the server doesn't own, such as microsoft.com, it passes the query to a forwarder or looks it up through the root servers.

Creating zones and records takes a few lines of PowerShell:

Add-DnsServerPrimaryZone -Name "cloudlearn.local" -ZoneFile "cloudlearn.local.dns"
Add-DnsServerPrimaryZone -NetworkId "10.0.1.0/24" -ZoneFile "1.0.10.in-addr.arpa.dns"
Add-DnsServerResourceRecordA -ZoneName "cloudlearn.local" -Name "webserver" -IPv4Address "10.0.1.10"
Resolve-DnsName -Name "webserver.cloudlearn.local" -Server 10.0.1.4

The last line checks your work by asking the DNS server at 10.0.1.4 directly. nslookup webserver.cloudlearn.local 10.0.1.4 does the same job.

The DHCP Server Role: Scopes, Exclusions, and Reservations

A DHCP server needs to know which addresses it may hand out and what extra settings to send. Four pieces cover almost everything:

  • A scope is the pool of addresses to lease, such as 10.0.1.100 to 10.0.1.200.
  • An exclusion range removes addresses from that pool so they're never leased. You use it for servers and printers that have fixed addresses inside the scope range.
  • A reservation always gives one device the same address, matched by its MAC address. The device still uses DHCP, but its address never changes.
  • Scope options carry the extra settings: option 3 is the default gateway (router), option 6 is the DNS server, and option 15 is the DNS domain name.

Each piece maps to one cmdlet:

Add-DhcpServerv4Scope -Name "CloudLearn-Scope" -StartRange 10.0.1.100 -EndRange 10.0.1.200 -SubnetMask 255.255.255.0 -State Active
Add-DhcpServerv4ExclusionRange -ScopeId 10.0.1.0 -StartRange 10.0.1.100 -EndRange 10.0.1.110
Add-DhcpServerv4Reservation -ScopeId 10.0.1.0 -IPAddress 10.0.1.150 -ClientId "AA-BB-CC-DD-EE-FF" -Name "ReservedPrinter"
Set-DhcpServerv4OptionValue -ScopeId 10.0.1.0 -Router 10.0.1.1 -DnsServer 10.0.1.4 -DnsDomain "cloudlearn.local"

The lease duration decides how long a device keeps its address before it must renew. Short leases recycle addresses faster on busy guest networks. Long leases mean less DHCP traffic on stable office networks.

The Azure Caveat: Azure Runs Its Own DHCP

Here's what surprises most people who practice this on a cloud VM. An Azure virtual network already provides DHCP and DNS to every VM in it. Every Azure VM gets its private IP from Azure's own DHCP service, based on the address assigned to its network interface in Azure.

So a DHCP role installed on an Azure VM doesn't serve other VMs in the VNet. Broadcast traffic isn't supported in Azure virtual networks, so a VM's DHCP request never reaches your server. According to the Azure Virtual Network FAQ, the one real use is serving on-premises clients through a DHCP relay agent, which forwards their requests to the Azure server as unicast traffic. Outside that, a DHCP role on an Azure VM is for learning the configuration.

Set Static IPs on the Azure NIC, Not in Windows

To give your DNS server VM a fixed address, set its private IP to Static on the Azure network interface and leave Windows on DHCP. Microsoft warns that setting a different address inside the operating system can cut off your connection to the VM.

The DNS role works normally on an Azure VM. To make other VMs use it, set the VNet's DNS servers to the VM's private IP, and have the server forward names it doesn't own to Azure DNS at 168.63.129.16.

This matters because when you build real systems, knowing which network owns DHCP saves you from troubleshooting a scope that was never going to get a request. Build both roles from scratch, create forward and reverse zones with A, CNAME, MX and PTR records, then configure a scope with exclusions, a reservation and options in the Windows Server DNS and DHCP Configuration on Azure lab on cloudlearn.io. You'll verify the DNS side with real lookups and the DHCP side by inspecting the scope and its statistics.

Common Mistakes to Avoid

  • Leaving a static address inside the scope without an exclusion. On an on-premises network, the DHCP server can lease that same address to another device, and the two machines end up in an IP conflict.
  • Forgetting the reverse lookup zone. Forward lookups work, so everything seems fine until a mail server or audit tool starts failing PTR checks.
  • Expecting a DHCP role on an Azure VM to serve the VNet. Azure's own DHCP always leases addresses to Azure VMs.
  • Setting a static IP inside Windows on an Azure VM. Set it on the Azure NIC instead.
  • Pointing scope option 6 at the wrong server. Every client that renews picks up the bad DNS address, so name resolution fails across the network at once.

Where to Start

The short version: DHCP hands out addresses and tells clients where DNS lives, and DNS turns names into those addresses. On-premises, Windows Server can run both. In Azure, the platform runs DHCP for you, and your Windows DNS server joins in through the VNet's DNS settings.

  • Open the lab and build both roles in PowerShell, from installing them to testing every record type.
  • Read Microsoft's DHCP Server quickstart for the console steps alongside PowerShell.
  • Try a forward and a reverse lookup for the same server and confirm the answers match.

Practice this in hands-on Azure labs