DNS Scavenging Not Working: Stale Records Not Deleted or Deleted Unexpectedly

Windows DNS scavenging not deleting stale records, or deleting ones you need? Check the record, zone and server settings, Refresh + No-refresh vs the DHCP lease, events 2501 and 2502, and the replication check that blocks scavenging.

Home › Guides › DNS scavenging not working

Last updated 21 November 2026

Quick answer

Windows DNS scavenging only deletes a stale record when it is enabled in three places: on the record (it has a timestamp), on the zone (aging enabled) and on at least one server (automatic scavenging enabled). If any level is missing, nothing is scavenged. Microsoft says most scavenging problems are configuration errors, so check those three levels first, make sure only one DNS server scavenges, and make sure Refresh + No-refresh >= the maximum DHCP lease.

Then track the scavenging cycle with DNS events 2501 (records were deleted) and 2502 (no records were deleted), and use the DNS Server Audit log events 521, 552, 554 and 567 to see what was deleted and when.

The three levels

LevelWhere to set itWhat to know
Resource recordDNS console, View > Advanced, record properties: Delete this record when it becomes staleDynamic (DDNS) records get a timestamp automatically. Static records have a timestamp of 0 and are never scavenged. dnscmd /ageallrecords timestamps every record in a zone, including static records you don't want scavenged.
ZoneZone Properties > General > AgingSets the No-refresh and Refresh intervals and shows The zone can be scavenged after timestamp. If you don't see that timestamp, reload the zone.
ServerServer Properties > Advanced > Enable automatic scavenging of stale recordsThe Scavenging period is how often this server scavenges. Only one server needs to scavenge because the zone data is replicated.

Records that can be scavenged are the ones registered with a timestamp: Windows clients with dynamic IP addresses that register through DDNS, and Windows machines with static IP addresses, which register in DNS every 24 hours. Records added manually as static records with no timestamp are never deleted by scavenging.

Set Aging/Scavenging for All Zones on the server only sets the defaults for new zones unless you select Apply these settings to the existing Active Directory-integrated zones. If a server-wide aging setting conflicts with a zone's own aging setting, the zone-level setting wins.

How a record becomes stale

The No-refresh interval is a period when a record can't be refreshed. A refresh is a dynamic update that only touches the timestamp; an update that changes the IP address is exempt. The No-refresh interval exists to reduce replication traffic. After the timestamp plus No-refresh interval, the Refresh interval starts, when the client may update its timestamp. If the client doesn't refresh during the Refresh interval, the record becomes eligible to be scavenged.

The safety checks the scavenging server runs before it deletes anything:

If all checks pass, any record where the current time is greater than its timestamp plus the No-refresh and Refresh intervals is deleted. Allow enough time for clients to make several registration attempts during the Refresh interval, or one failed refresh can make a record eligible.

Track the scavenging cycle

Event IDLogMeaning
2501DNS ServerThe scavenging cycle ran and one or more records were deleted
2502DNS ServerThe scavenging cycle ran and no records were deleted
521DNS Server AuditWhich records were deleted by scavenging
552DNS Server AuditStart of the scavenging cycle
554DNS Server AuditTermination of the scavenging cycle
567DNS Server AuditScavenge servers

To know when the next cycle runs, take the time of the most recent 2501 or 2502 event and add the server's scavenging period. You can also start a cycle by right-clicking the server and selecting Scavenge Stale Resource Records. Manual attempts don't bypass the safety checks, and Microsoft notes a manual run only deletes records instantly if scavenging has run automatically at least once on that server.

Microsoft's worked example: a zone with a 3-day Refresh and 3-day No-refresh interval, a 3-day scavenging period, the last 2501 or 2502 event at 6 AM on 1/1/2008, and a record timestamped noon on 1/1/2008. The record is deleted at approximately 6 AM on 1/10/2008.

Pick one scavenging server

You can let every server that hosts the zone scavenge, but Microsoft recommends having just one, so there is one place and one set of logs to check. To limit which servers may scavenge a zone:

dnscmd /zoneresetscavengeservers contoso.com 192.168.1.1 192.168.1.2

That example allows only the DNS servers at 192.168.1.1 and 192.168.1.2 to scavenge the contoso.com zone.

Common scenarios

Server records with static IPs disappear

Static-IP machines re-register every 24 hours by default. In Microsoft's example the Refresh and No-refresh intervals are 2 hours each and scavenging runs every 7 days, so a record timestamped 6:00 PM becomes stale at 10:00 PM and is deleted by the 11:00 PM scavenging cycle. Name resolution for that server then fails until it registers again. The cause is a Refresh + No-refresh total under 24 hours.

Scavenging never runs and no 2501 or 2502 events appear

Before scavenging, the server checks that the directory partition holding the zone has replicated since boot: if the partition hasn't fully synced with at least one replication partner in the last zone refresh interval, the zone isn't scavenged. This stops a DC that was offline for a long time from deleting data that was updated on other DCs. Microsoft describes this happening when the replication partner of the DC is being decommissioned; if that DC is no longer needed, removing it solves the issue. List the DCs in the domain with:

nltest /dclist:<DomainName>

If replication itself is failing, see common AD replication errors.

Azure VM records get deleted

Azure machines have a DHCP lease of 136 years, so they don't update their timestamps and scavenging deletes their records. Force them to register on an interval with the Registration Refresh Interval policy:

Computer Configuration\Administrative Templates\Network\DNS Client\Registration Refresh Interval

It maps to HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\DNSClient; the default is 1800 seconds (30 minutes) and Windows must be restarted for a change to take effect. On Windows clients, enable the Dynamic Update policy in the same folder first.

A static record was deleted

A record registered dynamically and then converted to static by removing its timestamp can still be deleted through DDNS. Review who has delete access to the record.

Turning scavenging on for an existing zone

Microsoft's safest procedure takes four to five weeks with default settings:

  1. Setup: turn off scavenging on all servers (you can limit it to one server with dnscmd /zoneresetscavengeservers and keep that server disabled). Turn on aging on the zones; Microsoft recommends lowering the No-refresh interval and leaving the Refresh interval at the default. Wait until today plus both intervals has passed.
  2. Sanity check: look for records older than Refresh plus No-refresh. For each one, check whether ipconfig /registerdns works, who owns the record (Security tab), whether an admin created it statically and then enabled scavenging (if so, delete it and run ipconfig /registerdns), and whether AD replication is healthy. Don't continue until you can explain every old record: the next phase deletes them.
  3. Enable: enable scavenging on a single server, create a test record enabled for scavenging, and predict when it disappears: timestamp + Refresh + No-refresh, then the next 2501 or 2502 event plus the scavenging period.

Related tools and guides

Look up DNS events 2501 and 2502 in the Windows Event ID Lookup, copy the dnscmd /zoneresetscavengeservers and nltest /dclist lines from the PowerShell Cheat Sheet, pull record names out of exported DNS Server Audit event 521 entries with the Regex Tester, check which subnets your DHCP scopes and DNS zones cover with the IPv4 Subnet Calculator or IPv6 Subnet Calculator, and identify the vendor of devices whose records keep disappearing with the MAC Vendor Lookup. Related guides: DHCP DNS dynamic updates not working, DNS Server event 7062, DNS Server events 4000, 4007, 4004 and 4016 and common AD replication errors.

Live records disappearing instead of stale ones staying? See DNS records missing from a zone.

Two names with the same IP address because records outlive their DHCP leases? See multiple DNS records with the same IP address.

Using DNS policy zone scopes? Scavenging and dynamic updates only work in the default zone scope; see split-brain DNS with DNS policy.

Every AD replication error code with its cause and fix: common Active Directory replication errors.

Every Windows DNS Server and DHCP Server event and symptom in one place: common Windows DNS Server and DHCP Server errors.

FAQ

Why is DNS scavenging not deleting stale records?

Scavenging must be set on three levels: the record must have a timestamp, aging must be enabled on the zone, and automatic scavenging must be enabled on at least one server. If any level is missing, nothing is scavenged. Static records with no timestamp are never deleted.

How do I know when DNS scavenging last ran?

Look for DNS event 2501, which means the cycle ran and deleted records, or 2502, which means it ran and deleted nothing. Add the server's scavenging period to the time of the latest event to get the next cycle.

Why did scavenging delete records for servers with static IP addresses?

Static-IP machines re-register every 24 hours by default. If the Refresh plus No-refresh interval is less than 24 hours, their records go stale before they refresh and the next cycle deletes them. Keep Refresh plus No-refresh at least equal to the maximum DHCP lease.

Should every DNS server scavenge?

Microsoft recommends just one, because the zone data is replicated and one server gives you one set of logs to check. Use dnscmd /zoneresetscavengeservers to limit which server IP addresses may scavenge a zone.

Why are no events 2501 or 2502 logged at all?

The server does not scavenge a zone if its directory partition has not fully synced with at least one replication partner within the zone refresh interval since the DNS service started. Microsoft describes this when the replication partner is a DC being decommissioned.

Want the full kit?

Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.