Troubleshooting

Windows Server 2025 DHCP and DNS Integration: Dynamic Updates, Name Protection, and Scavenging for AD Environments

Aseem Kishore
16 min read

The Back Room Tech is reader-supported. We may earn a commission when you buy through links on our site. Learn more.

Windows Server DHCP DNS dynamic updates connect the two roles. When a client gets a lease, DHCP can register its A and PTR records in your AD-integrated zone, so nobody creates host records by hand. Broken setups usually fail one of two ways: the wrong account owns the records, or nothing ever cleans them up.

The fix has four parts, and order matters. Give DHCP its own low-privilege DNS credential. Set the update mode and turn on Name Protection. Review record timestamps before you enable aging. Then turn on scavenging at both the zone level and the server level. The boring audit steps are the ones that save you.

What Is DHCP-to-DNS Dynamic Update?

Dynamic update lets DNS clients, or a DHCP server acting for them, register and update their own resource records. AD-integrated zones normally accept secure dynamic updates only.

With secure updates, each record has an access control list (ACL). By default, the account that creates a record becomes its owner, and the ACL normally lets only that owner (plus administrators) update it. The exact rights still depend on the record’s security descriptor, the identity DHCP registers with, whether the record already existed, and DnsUpdateProxy membership, which is covered below.

That ownership model causes most of the trouble:

  • Wrong owner. Say DHCP registers a record with one identity and later tries to update it with another. The update is denied. A replacement device with the same hostname can also be blocked by the old owner’s ACL.
  • No cleanup. A retired laptop’s A record stays in the zone forever unless aging and scavenging are on.

Microsoft’s dynamic update troubleshooting guide covers both failure modes. This tutorial puts the fixes in a safe order.

Before You Begin

  • Windows Server 2025 with the DHCP Server role installed and authorized. See our DHCP role installation guide if you haven’t done this yet. Microsoft documents dynamic update as applying to Windows Server 2016, 2019, 2022, and 2025.
  • DNS Server role with an Active Directory-integrated forward lookup zone, plus the matching reverse lookup zone for PTR records
  • Domain Admin rights, or delegated rights to manage DHCP server settings and DNS server/zone properties
  • Permission to create a standard domain user account
  • An elevated PowerShell session on the DHCP server with the DhcpServer and DnsServer modules. Both come with the role management tools.
  • Your DHCP lease duration written down. You’ll need it to size the aging intervals.
RequirementDetails
OSWindows Server 2025 (behavior also applies to 2016/2019/2022)
RolesDHCP Server, DNS Server
Zone typeAD-integrated, dynamic updates set to Secure only
ToolsDHCP console (dhcpmgmt.msc), DNS Manager (dnsmgmt.msc), PowerShell
Out of scopeDHCP failover and reservations (see our separate DHCP failover and DHCP reservations articles)

Note: The examples use corp.example.com, dhcp01.corp.example.com, and 192.168.10.0 as placeholders. Replace them with your own values.

For a homelab, a DC plus DHCP on a small mini PC works well. In production, Microsoft’s dynamic update troubleshooting guidance recommends hosting DHCP on a separate server rather than a domain controller, so DHCP never registers records with DC-level rights. If you must co-locate the roles, the dedicated credential in Step 2 matters even more.

Either way, put the server on a UPS. An AD-integrated DNS server that loses power mid-replication will cause you far more grief than any scavenging setting.

Step-by-Step Guide

Step 1: Audit the Current DHCP and Zone Settings

Record what you have before you change anything. Run this on the DHCP server:

# Server-level DNS registration settings for IPv4
Get-DhcpServerv4DnsSetting -ComputerName "dhcp01.corp.example.com"

You should see properties like these. The values depend on your current setup.

DeleteDnsRROnLeaseExpiry   : True
DisableDnsPtrRRUpdate      : False
DnsSuffix                  :
DynamicUpdates             : OnClientRequest
NameProtection             : False
UpdateDnsRRForOlderClients : False

Next, confirm the zone is AD-integrated and set to secure updates:

Get-DnsServerZone -Name "corp.example.com" | Format-List ZoneName, ZoneType, IsDsIntegrated, DynamicUpdate
ZoneName       : corp.example.com
ZoneType       : Primary
IsDsIntegrated : True
DynamicUpdate  : Secure

If DynamicUpdate shows NonsecureAndSecure, record ownership isn’t enforced. Fix that first in DNS Manager under zone Properties > General > Dynamic updates.

Step 2: Create a Dedicated DNS Registration Account

Create a standard domain user. Don’t add it to any admin groups. DHCP will use it only to register records.

# Prompts for the password so it never sits in your shell history
New-ADUser -Name "svc-dhcpdns" `
  -SamAccountName "svc-dhcpdns" `
  -Description "DHCP DNS dynamic update credential - no other use" `
  -AccountPassword (Read-Host -AsSecureString "Password") `
  -PasswordNeverExpires $true `
  -Enabled $true

-PasswordNeverExpires avoids making DNS registration dependent on password rotation timing. If your policy requires rotation anyway, update the DHCP credential in Step 3 whenever you change the password — an outdated credential can stop DHCP from registering records in DNS.

That convenience is a security trade-off, not a universal default. A non-expiring password is a standing credential, so keep the account out of every privileged group, give it a long random password, and watch its sign-ins. If your organization requires password expiry or managed service accounts, follow that policy and build the credential update into your rotation runbook.

Why DHCP can’t just use its machine account: with no credential set, DHCP registers records as the server’s computer account. On a domain controller, that account holds DC-level rights. So every record DHCP creates is owned by an account that can also change records you care about, including the DC’s own.

A dedicated low-privilege account reduces that privilege-escalation risk. It’s still a shared credential, though: anyone who compromises it can change the records it owns, so protect it like any other service account. It also keeps ownership consistent. If every DHCP server in the domain uses the same credential, any of them can update a record another one created.

Warning: DnsUpdateProxy: Older guidance often tells you to add the DHCP server to the DnsUpdateProxy group instead of configuring a credential. Records created by members of that group aren’t secured to an owner, so any authenticated account can take them over. If the DHCP server is a DC and joins that group, the problem grows: records that DC registers, including its own, can lose their ownership protection. Use the dedicated credential. If you inherited a server in DnsUpdateProxy, remove it after Step 3 is working, and read Microsoft’s current DnsUpdateProxy guidance before deciding whether anything else belongs in that group.

Step 3: Configure the DHCP DNS Credential

  • Open the DHCP console (dhcpmgmt.msc).
  • Expand the server, right-click IPv4, and select Properties.
  • Open the Advanced tab and click Credentials.
  • Enter svc-dhcpdns, your domain name, and the password. Click OK.
  • If registrations don’t pick up the new credential, restart the DHCP Server service. Schedule that for a quiet window on a production server.

The dialog’s location can vary slightly between builds. Look for the Credentials button on the IPv4 Advanced tab.

DHCP console IPv4 Properties Advanced tab with the DNS Dynamic Update Registration Credentials dialog open, showing User name, Domain, and Password fields filled with svc-dhcpdns and the domain name

To script the same change, use Set-DhcpServerDnsCredential from the DhcpServer module. It takes a PSCredential object, so the password never appears on the command line:

# Prompts for the svc-dhcpdns user name and password
$cred = Get-Credential
Set-DhcpServerDnsCredential -ComputerName "dhcp01.corp.example.com" -Credential $cred
# Restart-Service DHCPServer   # only if registrations don't pick up the change

The legacy netsh equivalent still works, but it puts the password in plain text on the command line and in your shell history:

# netsh syntax: set dnscredentials <username> <domain> <password>
netsh dhcp server set dnscredentials svc-dhcpdns corp.example.com YOUR_PASSWORD

Warning: DHCP DNS credentials are not included in DHCP database backups. After any restore, set the credential again by hand.

Step 4: Set the Dynamic Update Mode

  • In the DHCP console, right-click IPv4 > Properties > DNS tab.
  • Check Enable DNS dynamic updates according to the settings below.
  • Choose one of the two update options. The table below explains what each does.
  • Check Discard A and PTR records when lease is deleted if you want DHCP to remove records when a lease is deleted.
DHCP console IPv4 Properties DNS tab showing the dynamic update radio buttons (only if requested by clients / always update) and the Name Protection Configure button
Mode (-DynamicUpdates)Console equivalentWhat happens
OnClientRequest“Dynamically update DNS records only if requested by the DHCP clients”DHCP reads the client’s DHCP option 81 request and may register the A and/or PTR records based on that request and how the client itself is configured. It isn’t a fixed rule that DHCP always takes the PTR while the client always takes the A record — the split depends on the client.
Always“Always dynamically update DNS records”DHCP registers both A and PTR records for the client, regardless of what the client requests.
NeverDNS dynamic updates checkbox clearedDHCP registers nothing. Clients that can register themselves still do.

Use Always when you want DHCP to own registration for everything, regardless of what the client requests. Every record then has one consistent owner.

Use OnClientRequest when you want DHCP to follow the client’s option 81 request instead. Client self-registration can still introduce mixed record owners and complications with multi-homed or VPN clients; Microsoft’s troubleshooting guide covers some of these edge cases.

PowerShell equivalent, applied at the server level:

Set-DhcpServerv4DnsSetting -ComputerName "dhcp01.corp.example.com" `
  -DynamicUpdates Always `
  -DeleteDnsRROnLeaseExpiry $true   # remove A/PTR when the lease is deleted

You can also scope the setting to a single scope, a policy, or a reservation. The Set-DhcpServerv4DnsSetting reference covers each. For example:

# Override just one scope
Set-DhcpServerv4DnsSetting -ComputerName "dhcp01.corp.example.com" -ScopeId 192.168.10.0 -DynamicUpdates OnClientRequest

For IPv6 scopes, use Set-DhcpServerv6DnsSetting.

Step 5: Enable Name Protection

Name Protection stops one DHCP client from silently taking over another client’s DNS name. With it on, DHCP writes a DHCID record next to the A record. That record ties the name to the client that registered it. If a different client later asks for the same name, the update is rejected. The existing record stays put.

On the DNS tab, click Configure under Name Protection and check Enable Name Protection. Or use PowerShell:

Set-DhcpServerv4DnsSetting -ComputerName "dhcp01.corp.example.com" -NameProtection $true

When Name Protection blocks an update, DNS registration for that client fails and its name keeps resolving to the first client’s IP address. Check the DHCP audit log around that time for a failed DNS update entry to help confirm this is what happened. That’s Name Protection doing its job.

Before you disable it, find out why two devices claim the same name. Common causes are a reimaged machine that kept its old hostname, a stale record, or a naming collision.

Step 6: Verify Records Are Registering

Renew a lease on a test client, then check DNS from the DHCP server:

# On the client (run in its own shell)
ipconfig /release
ipconfig /renew

# On the server
Get-DnsServerResourceRecord -ZoneName "corp.example.com" -Name "ws-test01"
Get-DnsServerResourceRecord -ZoneName "corp.example.com" -RRType DHCID

You should see an A record for the test client. If Name Protection is on, you should also see a DHCID record. Next, open DNS Manager, right-click the A record, and select Properties > Security. For a record DHCP created after Step 3, the owner should be svc-dhcpdns.

If the owner is the DHCP server’s computer account, the record existed before the credential change. It’ll keep that owner until it’s removed and registered again.

Check the reverse lookup zone for the PTR record too.

Step 7: Review Stale Timestamps Before Enabling Scavenging

This is the step people skip. Scavenging deletes any aged record whose timestamp is too old. That includes servers that are still running but stopped refreshing. See what would be deleted first.

The 14-day cutoff below matches Microsoft’s default no-refresh and refresh intervals (7 days each) — it isn’t a fixed threshold that fits every environment. Set $cutoff to match the no-refresh + refresh sum you actually plan to configure in Step 9, and extend it if you use longer intervals.

# List dynamic A records not refreshed within the no-refresh + refresh window
# (14 days shown here reflects Microsoft's 7+7 day defaults; adjust to match Step 9)
$cutoff = (Get-Date).AddDays(-14)
Get-DnsServerResourceRecord -ZoneName "corp.example.com" -RRType A |
  Where-Object { $_.Timestamp -and $_.Timestamp -lt $cutoff } |
  Sort-Object Timestamp |
  Format-Table HostName, Timestamp, @{n='IPv4';e={$_.RecordData.IPv4Address}} -AutoSize

Static records have an empty or zero timestamp and are never scavenged. Every record this query returns would become a deletion candidate once aging is on for the zone and scavenging runs on a server. Treat the list as a review queue: ping each one, check it against your CMDB or AD computer objects, and flag anything that’s still live.

Elevated PowerShell window showing Get-DnsServerResourceRecord output with HostName, Timestamp, and IPv4 columns, mixing dynamic records with dated timestamps and static records with no timestamp

A dynamic record that goes unrefreshed for your configured no-refresh + refresh sum becomes eligible (stale). It’s actually deleted only when the next scavenging pass runs on a server with scavenging enabled. Static records with a zero timestamp never become eligible.

Step 8: Protect Records That Must Never Be Scavenged

Some live records from Step 7 must stay: printers, appliances, or a server someone pointed at DHCP by mistake. For each one:

  • In DNS Manager, open the record’s Properties. You may need View > Advanced enabled to see the timestamp fields.
  • Clear Delete this record when it becomes stale.
  • Click OK.

Clearing the box sets the record’s timestamp to zero. That exempts it from scavenging permanently, per Microsoft’s aging and scavenging guidance. Run the Step 7 query again until only truly dead records remain.

Step 9: Enable Aging on the Zone

  • In DNS Manager, right-click the zone > Properties > General tab > Aging.
  • Check Scavenge stale resource records.
  • Set No-refresh interval and Refresh interval.
  • Click OK, and repeat for the reverse lookup zone.
DNS Manager Zone Aging/Scavenging Properties dialog for an AD-integrated zone with Scavenge stale resource records checked and the No-refresh interval and Refresh interval fields visible

The two intervals work like this:

  • No-refresh interval: after a record’s timestamp is set, refreshes are ignored for this period. This keeps AD replication traffic down.
  • Refresh interval: after no-refresh ends, the record must be refreshed within this window. If it isn’t, it goes stale.

A dynamic record becomes eligible for scavenging once no-refresh + refresh has passed with no refresh; the next scavenging pass then deletes it. Rule of thumb: make that sum at least as long as your longest DHCP lease. That way an active client refreshes before its record is eligible. Seven days for each interval (14 days total) is a common starting point for leases of 8 days or less; longer leases need longer intervals.

PowerShell equivalent. Verify parameter names in the current Microsoft Learn reference before scripting:

Set-DnsServerZoneAging -Name "corp.example.com" -Aging $true `
  -NoRefreshInterval 7.00:00:00 -RefreshInterval 7.00:00:00   # d.hh:mm:ss
Get-DnsServerZoneAging -Name "corp.example.com"

Zone aging alone deletes nothing. It only stamps and evaluates records. Deletion is the next step.

Step 10: Enable Scavenging on the DNS Server

Pick one DNS server to run scavenging. Microsoft recommends one scavenging server per zone, which keeps unexpected deletions traceable; you can enforce that with Set-DnsServerZoneAging -ScavengeServers. Its troubleshooting guidance also suggests a DC without FSMO roles, and especially not the PDC emulator, where possible. Server-level scavenging doesn’t replicate, so enable it only on that server. Then:

  • In DNS Manager, right-click the server > Properties > Advanced tab.
  • Check Enable automatic scavenging of stale records.
  • Set Scavenging period. Microsoft documents 7 days as the recommended value.
  • Click OK.
DNS server Properties Advanced tab with Enable automatic scavenging of stale records checked and Scavenging period set to 7 days

PowerShell equivalent:

Set-DnsServerScavenging -ScavengingState $true -ScavengingInterval 7.00:00:00
Get-DnsServerScavenging

Step 11: Verify Scavenging

Get-DnsServerScavenging
Get-DnsServerZoneAging -Name "corp.example.com"

Confirm three things: scavenging is enabled, the interval matches what you set, and aging is True on both forward and reverse zones. After a scheduled run, check Event Viewer > Applications and Services Logs > DNS Server for one of two events:

  • Event ID 2501: a scavenging pass ran and deleted records. Review which records it removed.
  • Event ID 2502: a pass ran but deleted nothing. That’s the normal, healthy result when every record is current.

Then run the Step 7 query again. The dead records should be gone, and your protected ones should still be there.

Warning: Start-DnsServerScavenging forces an immediate run. Only use it after Step 7 and Step 8 are done. A forced run deletes every eligible record in every aging-enabled zone.

Configuration Reference

SettingWhereDefaultRecommendation
DynamicUpdatesDHCP DNS tab / Set-DhcpServerv4DnsSettingOnClientRequest-style behaviorAlways for consistent ownership; OnClientRequest if clients self-register
NameProtectionDHCP DNS tab > ConfigureOffOn
DeleteDnsRROnLeaseExpiryDHCP DNS tabCheck yours (Step 1)On
DNS credentialIPv4 Properties > Advanced > CredentialsNone (uses computer account)Dedicated standard user
Zone agingZone Properties > AgingOff on new zonesOn, intervals sized against lease duration
Server scavengingServer Properties > AdvancedOffOn, on one server, 7-day period
Per-record protectionRecord PropertiesEligible once aging is onClear for anything that must persist

If Something Goes Wrong

  • Run Get-DhcpServerv4DnsSetting again and confirm the mode and Name Protection settings.
  • Check the record’s owner on its Security tab.
  • Read the DHCP audit logs in C:\Windows\System32\dhcp\. Each day has its own file, such as DhcpSrvLog-Mon.log, and the header of each file lists the event codes. DNS update entries use ID 30 (request), 31 (failed), and 32 (successful). Each line includes the client’s IP address and hostname, so you can match a failed update to a specific lease.
  • Check Event Viewer under DHCP-Server and DNS Server in Applications and Services Logs. On the DHCP side, event IDs 20317 and 20319 flag failed IPv4 forward (A) and PTR registrations, with the FQDN and error code. A 20319 usually points to a missing or misconfigured reverse lookup zone.

Common Issues

DHCP clients never appear in DNS

Why it happens: Dynamic updates are off on the DNS tab, the client didn’t request registration under OnClientRequest, or DHCP can’t authenticate to a secure-only zone.

Fix: Confirm the DNS tab settings. Switch to Always if your clients don’t send option 81. Re-enter the credential from Step 3.

Secure updates fail with access denied

Why it happens: DHCP is using its computer account, or a different account owns the existing record.

Fix: Set the dedicated credential, then delete the old record so it registers again under svc-dhcpdns.

A replacement device can’t register its name

Why it happens: A stale A record owned by the old device’s identity blocks the update. With Name Protection on, a DHCID conflict can do the same.

Fix: Confirm the old device is really gone, then delete the stale record. Aging and scavenging will handle this for you from now on. Don’t disable Name Protection as a shortcut.

Scavenging is “on” but nothing gets deleted

Why it happens: Only one of the two switches is enabled.

Fix: Check both Get-DnsServerZoneAging and Get-DnsServerScavenging. Records only become eligible after no-refresh + refresh has passed.

An important record got scavenged

Why it happens: The record had a dynamic timestamp and no protection.

Fix: Recreate it, then clear Delete this record when it becomes stale on the new record.

Credential missing after a DHCP restore

Why it happens: DNS credentials aren’t stored in DHCP backups.

Fix: Repeat Step 3.

Tips and Hidden Features

  • Same credential on every DHCP server: Use one shared account everywhere so any server can update records another created. This matters if you run DHCP failover (see our DHCP failover article).
  • Reservations have their own DNS settings: Set-DhcpServerv4DnsSetting accepts reservation-level overrides. See our DHCP reservations article for setting up the reservations themselves.
  • Sort DNS Manager by timestamp: With View > Advanced on, DNS Manager shows a Timestamp column. It’s a quick visual version of the Step 7 audit.

Wrapping Up

DHCP now registers records under one low-privilege owner. Name Protection blocks silent overwrites, and stale entries age out on a schedule you control. The credential is the part people skip, and it causes most of the “random” access-denied failures. Scavenging is the part people fear. Do the timestamp review first and both are safe.

StepActionApplies To
1–3Audit, create account, set DHCP credentialDHCP server
4–6Update mode, Name Protection, verifyDHCP server
7–8Review timestamps, protect live recordsDNS zone
9–11Zone aging, server scavenging, verifyDNS zone + one DNS server

Resources