Windows · DNS

DNS Aging and Scavenging

Aging and scavenging are the two settings that decide whether stale DNS records clean themselves up automatically or sit in the zone indefinitely, and getting the intervals wrong deletes records that are still in use.

Quick idea: Aging tracks how recently a DNS record was refreshed; scavenging periodically deletes records aging marks as stale. Both are disabled by default, and both have to be enabled together, on the right zones, with intervals wide enough that a temporarily offline client doesn’t lose its own record.
Aging

Stamps records with a timestamp and decides when a refresh is allowed to update it.

Scavenging

The periodic sweep that deletes any record aging has marked as stale.

dnsTombstoned

The Active Directory attribute that marks a record’s node as logically deleted before it’s fully removed.

What Is DNS Aging and Scavenging?

Dynamic update lets a computer register its own DNS record the moment it boots. Nothing on the other side of that transaction removes the record when the computer disappears — a laptop that loses power mid-shutdown, a VM that’s deleted without ever running an OS-level deregistration, a server that’s decommissioned and just switched off. Left alone, DNS keeps answering queries for a host that no longer exists.

Think of aging as a sell-by date stamped on a record, and scavenging as the periodic check that throws out anything past its date. Neither one does anything on its own: aging just tracks the timestamp, and scavenging just deletes whatever aging has marked as expired. You have to enable both, and this feature covers Windows DNS Server going back to Windows 2000 — the intervals and event IDs below are unchanged through Windows Server 2022 and 2025.

This applies specifically to standard primary and Active Directory-integrated zones. Secondary and stub zones don’t support aging or scavenging at all — a secondary zone’s data is a read-only copy of whatever its primary sends it, so there’s nothing local to age. This post assumes the DNS Server role is already installed and zones already exist; for the role itself, zone types, and dynamic update, see Windows DNS Server.

How the Intervals Actually Work

Every dynamically-created record gets two clocks. The no-refresh interval starts the moment a record’s timestamp is set, and during that window the server ignores refresh attempts for that record entirely — it acknowledges them as successful without writing anything, purely to cut down on replication traffic from clients that re-register far more often than necessary. Once the no-refresh interval closes, the refresh interval opens, and only now can a client’s refresh actually update the timestamp. If nothing refreshes the record before the refresh interval also closes, the record is stale.

Condition What It Means
Scavenging enabledServer-level setting. Off by default, and doesn’t replicate — set it individually on every DNS server you want scavenging.
Aging enabled on the zoneZone-level setting. For an AD-integrated zone this does replicate with the zone data once set.
Record has a nonzero timestampOnly dynamically registered records qualify. Manually created static records get a timestamp of zero and are permanently exempt unless later updated dynamically.
Record timestamp + no-refresh + refresh < current server timeThe actual staleness formula. With both intervals at their 7-day default, a record becomes eligible after 14 days of no refresh.

All four conditions have to be true before a record is actually removed. Miss any one — scavenging off, aging off on that specific zone, a record that was never dynamic, or the math not yet past the threshold — and the record stays untouched no matter how old it looks.

Important: A stale record can persist for up to no-refresh + refresh + scavenging period past its last real update — up to 21 days with every interval left at its 7-day default. Scavenging removes a record on the next scheduled sweep after it crosses the threshold, not the instant it crosses it.

On an Active Directory-integrated zone, deletion isn’t instant either. AD DS stores every record for a name — A, AAAA, and so on — as values inside a single dnsNode object. When scavenging removes the last record for that name, the DNS Server service sets the node’s dnsTombstoned attribute to TRUE rather than deleting it outright, replicates that logical deletion to every other DNS server hosting the zone, and only then does normal AD directory cleanup remove the object permanently. This is the same tombstone lifecycle mechanism AD uses for deleted objects generally — it’s what lets replication catch up before the record is gone everywhere.

Why This Is Off by Default

Microsoft’s own guidance on this is unusually direct: enable aging and scavenging only after you understand every interval, because a misconfiguration deletes records that are still in use and leaves users unable to resolve them. The most common way this actually happens in practice is setting the refresh interval shorter than the DHCP lease duration — a client that only re-registers once a day gets scavenged out from under itself if the combined no-refresh-plus-refresh window is, say, four hours.

Practical rule: Keep the combined no-refresh and refresh interval equal to or greater than your DHCP lease duration. The 7-and-7-day defaults are conservative enough for almost any environment; shortening them buys faster cleanup at direct risk to records that are only temporarily quiet.

For what it actually looks like when this goes wrong in the other direction — scavenging never enabled at all, and a decommissioned host’s record lingering indefinitely — see Stale DNS Records After a Domain Controller Decommission.

Enabling Aging and Scavenging

Both the GUI and PowerShell paths configure the same two layers — aging on the zone, scavenging on the server — and neither is complete without the other.

In DNS Manager (dnsmgmt.msc), enable aging on a single zone by right-clicking it, choosing Properties, then the Aging tab, and selecting Scavenge stale resource records with the No-refresh and Refresh interval values you want. To apply aging to every zone at once — including zones that already exist — right-click the server name instead and choose Set Aging/Scavenging for All Zones, then check Apply these settings to the existing Active Directory-integrated zones on the confirmation dialog; without that box checked, the new settings only apply to zones created afterward. Server-level scavenging itself lives one level up: right-click the server, Properties, the Advanced tab, then Enable automatic scavenging of stale records with a scavenging period (7 days by default, 1 hour minimum).

# Enable scavenging on the DNS server: 7-day interval, applied to every existing zone
Set-DnsServerScavenging -ScavengingState $true -ScavengingInterval 7.00:00:00 -ApplyOnAllZones

# Enable aging on one zone with the default 7-day intervals
Set-DnsServerZoneAging -Name "corp.example.com" -Aging $true -NoRefreshInterval 7.00:00:00 -RefreshInterval 7.00:00:00

# Restrict which DNS server is allowed to scavenge this zone
# (Microsoft recommends exactly one scavenging server per zone)
Set-DnsServerZoneAging -Name "corp.example.com" -Aging $true -ScavengeServers 10.10.0.10

# Review current settings before or after changing anything
Get-DnsServerScavenging
Get-DnsServerZoneAging -Name "corp.example.com"

# Trigger an immediate scavenging pass instead of waiting for the next cycle,
# and see exactly what gets deleted
Start-DnsServerScavenging -Verbose
Key rule: Configure scavenging on only one DNS server per zone. Multiple servers scavenging the same zone independently spreads deletions across separate event logs, makes the schedule unpredictable, and turns an unexpected deletion into a much harder thing to trace back. Use -ScavengeServers to enforce it.

Protecting Records That Should Never Be Scavenged

Manually created records already get a zero timestamp and are exempt by default — that’s what makes a record “static” rather than “dynamic” from scavenging’s point of view. The exemption isn’t permanent for every record, though: if a record was created manually but later receives an authorized dynamic update, the server can assign it a nonzero timestamp during that update, which makes it eligible again.

For anything that must never be scavenged regardless — a domain controller’s own records, a load balancer VIP, a print server — open the record’s properties in DNS Manager and confirm Delete this record when it becomes stale is cleared. Clearing it forces the timestamp back to zero.

Monitoring Scavenging with the Event Log

Every scavenging cycle writes one event to the DNS Server event log, whether or not it actually deleted anything — that event is the fastest way to confirm scavenging is running at all, rather than inferring it from records slowly disappearing.

Event ID Meaning
2501A scavenging cycle ran and records were removed. Check the event detail for which ones.
2502A scavenging cycle ran and nothing needed removing — the normal, healthy state.
4013The server is waiting on Active Directory to initialize before it loads AD-integrated zones; scavenging is delayed until that finishes.
4515A duplicate zone was detected in Active Directory, which can block the affected zone from loading or scavenging correctly.
4521The server couldn’t load an AD-integrated zone at all, so nothing in it can be scavenged until the underlying error is resolved.

To work out when the next cycle runs, take the timestamp of the most recent 2501 or 2502 event and add the configured scavenging period. For AD-integrated zones specifically, cross-check replication health rather than assuming a record’s disappearance (or stubborn persistence) is a scavenging problem — repadmin /replsummary and repadmin /showrepl confirm whether the tombstone has actually propagated to every DNS server hosting the zone.

Aging and Scavenging Cheat Sheet

Setting Level Default
No-refresh intervalPer zone7 days
Refresh intervalPer zone7 days
Scavenging periodPer server, doesn’t replicate7 days (1 hour minimum)
Scavenging serversPer zone, optionalEvery DNS server hosting the zone, unless restricted

Common Mistakes and Fixes

Symptom Likely Cause Fix
Legitimate records disappearing shortly after enabling scavenging No-refresh plus refresh interval set shorter than the DHCP lease duration, or shorter than how often clients actually re-register. Widen both intervals so their combined total is at least as long as the DHCP lease. Run Get-DnsServerZoneAging to confirm current values before changing them.
Records that should be stale never get removed Aging enabled on the zone but scavenging never enabled server-side, or vice versa — the two settings are independent. Check both: Get-DnsServerScavenging for the server setting, Get-DnsServerZoneAging -Name <zone> for the zone. Both must show enabled.
Existing zone’s old records never get aged after turning scavenging on New aging settings only apply going forward unless explicitly pushed to existing records. Re-run Set-DnsServerScavenging -ApplyOnAllZones, or in DNS Manager use Set Aging/Scavenging for All Zones with Apply these settings to the existing Active Directory-integrated zones checked.
Scavenging appears to do nothing on an AD-integrated zone The zone failed to load, or Active Directory hasn’t finished initializing on that DNS server. Check the DNS Server event log for 4013, 4515, or 4521 around the expected scavenging time, and confirm AD replication health with repadmin /showrepl.
A static record gets deleted unexpectedly The record was later touched by an authorized dynamic update, which assigned it a nonzero timestamp and made it eligible again. Re-create the record and confirm Delete this record when it becomes stale is cleared in its properties, which resets the timestamp to zero.

Final Thoughts

Aging and scavenging are two of the few DNS settings that do nothing at all until you deliberately turn them on, and that’s by design — the failure mode of getting the intervals wrong is a name silently going unresolvable, which is a worse outage than the stale record you were trying to clean up. Test the intervals in a lab, back up zone data before the first production run, and watch event ID 2501 for the first few cycles before trusting it to run unattended.

Once it’s tuned to the environment’s real DHCP lease and client refresh behaviour, scavenging becomes the kind of maintenance that never needs attention again — which is exactly the point.

Key takeaway: Both Get-DnsServerScavenging and Get-DnsServerZoneAging have to show enabled before anything gets cleaned up automatically, and the combined no-refresh-plus-refresh interval should never be shorter than the DHCP lease duration it’s protecting against.
Next in this series

For the zone types, dynamic update rules, and record management that aging and scavenging sit on top of, see Windows DNS Server. For what unmanaged stale records look like once they’ve already caused a problem, see Stale DNS Records After a Domain Controller Decommission.