Applies to: Windows Server 2019, Windows Server 2022, and Windows Server 2025.
DNS aging and scavenging remove stale dynamic records while protecting static infrastructure entries.
Prerequisites
- Administrative access to the affected Windows Server hosts.
- A tested backup or documented rollback point.
- An approved maintenance window for production systems.
Step-by-step configuration
- Inventory zones and identify statically managed records.
- Set a conservative no-refresh and refresh interval on eligible zones.
- Enable scavenging on selected DNS servers.
- Review timestamps before the first scavenging cycle.
- Monitor deletion events and replication.
PowerShell and command-line procedure
Set-DnsServerZoneAging -Name "contoso.example" -Aging $true -NoRefreshInterval 7.00:00:00 -RefreshInterval 7.00:00:00
Set-DnsServerScavenging -ScavengingState $true -ScavengingInterval 7.00:00:00
Get-DnsServerZoneAging -Name "contoso.example"
Get-DnsServerResourceRecord -ZoneName "contoso.example" | Select-Object HostName,Timestamp
Verification
Eligible dynamic records show timestamps, static records remain protected, and only records beyond both intervals are removed.
Rollback
Disable zone aging and server scavenging, then restore mistakenly removed records from backup or authoritative source.
Security and operational guidance
- Apply least privilege and document every production change.
- Test the procedure in an isolated environment before broad deployment.
- Replace all example names, paths, and TEST-NET addresses with approved production values.
- Monitor relevant Windows event logs after the change.
Related resources
Deploy or manage Canadian Windows VPS infrastructure with networkmanager.info. Validate production decisions against the official Microsoft Windows Server documentation.