
Windows DNS servers play an essential role in Active Directory environments, allowing computers, servers, applications, and network services to locate resources by name.
As devices join and leave a network, their DNS records may remain in DNS zones long after the devices have been removed. These outdated entries are known as stale DNS records.
Over time, stale records can cause incorrect name resolution, increase DNS zone size, create unnecessary replication traffic, and make network troubleshooting more difficult.
Windows Server provides two related features to manage this problem: DNS Aging and DNS Scavenging.
Aging tracks the timestamps of dynamically registered DNS records, while scavenging identifies and removes records that have exceeded the configured aging intervals.
This guide explains how Windows DNS aging and scavenging work, how to configure them using DNS Manager and PowerShell, how to protect important records, and how to troubleshoot records that are not being deleted as expected.
Whether you administer a small Active Directory domain or a large enterprise network, understanding these settings helps maintain accurate DNS records without accidentally removing active network resources.
1. What Is Windows DNS Aging and Scavenging?
DNS Aging and Scavenging are Windows Server DNS features that work together to identify and remove outdated dynamic DNS records.
Consider an organization with an Active Directory domain named corp.example.com.
A laptop connects to the network and registers the following DNS record:
laptop01.corp.example.com A 192.168.10.45Later, the laptop is removed from the organization, but its DNS record remains in the zone.
DNS clients may continue receiving the old IP address when resolving that hostname.
This is a problem because DNS does not automatically delete every record when a device disconnects.
Windows DNS solves this with two mechanisms:
DNS Aging tracks the age of eligible DNS records using timestamps. It determines when a dynamic record can be refreshed and when it becomes stale.
DNS Scavenging periodically examines eligible records and deletes those that have exceeded the configured aging periods.
Both features are required for automatic stale-record cleanup.
Aging alone does not delete records, and enabling scavenging on a DNS server does not automatically make every record eligible for deletion.
For additional DNS fundamentals, see our guides on DNS Explained and How DNS Resolution Works.
2. Why Stale DNS Records Become a Problem
Stale DNS records accumulate when devices are removed, renamed, reconfigured, or disconnected without their DNS entries being cleaned up.
Common situations include:
- Computers removed from Active Directory.
- Laptops that connect to different networks.
- DHCP clients that receive new IP addresses.
- Virtual machines that are deleted or recreated.
- Servers that are decommissioned.
- Network devices that change their IP addresses.
- Temporary systems used for testing.
For example, suppose a DHCP client originally registers:
workstation01.corp.example.com A 192.168.10.45The device is later assigned a different IP address:
192.168.10.82If the original DNS record remains, administrators may encounter inconsistent name resolution.
Stale records can cause several problems:
| Problem | Possible Impact |
|---|---|
| Incorrect DNS responses | Clients resolve names to outdated IP addresses. |
| Duplicate or obsolete records | Troubleshooting becomes more complicated. |
| Larger DNS zones | More records must be stored and processed. |
| Increased replication traffic | Changes and larger zone data add directory replication overhead. |
| Application connectivity problems | Services may attempt to connect to an incorrect server address. |
In an Active Directory-integrated DNS environment, DNS records are replicated through Active Directory. However, Active Directory replication does not independently determine whether a DNS record is stale.
Aging and scavenging are still necessary to identify and remove outdated records.
3. DNS Aging vs. DNS Scavenging: Key Differences
Although administrators often use the terms together, DNS Aging and DNS Scavenging perform different functions.
| Feature | DNS Aging | DNS Scavenging |
|---|---|---|
| Primary purpose | Tracks record timestamps and refresh eligibility | Deletes stale DNS records |
| Uses timestamps | Yes | Yes |
| Deletes records | No | Yes |
| Configuration level | DNS zone | DNS server |
| Requires the other feature | Works as part of the aging process | Requires zone Aging to be enabled |
| Main benefit | Determines record age | Removes obsolete records |
How DNS Aging Works
When a DNS record is registered dynamically, Windows DNS can assign a timestamp to it.
The timestamp represents the last accepted registration or refresh time.
Aging uses two intervals:
- No-Refresh Interval.
- Refresh Interval.
These periods determine when a record can receive a new timestamp and when it becomes eligible for scavenging.
How DNS Scavenging Works
Scavenging periodically checks DNS zones that are configured for aging.
When a record has a nonzero timestamp and has exceeded both aging intervals, it can be removed during an eligible scavenging pass.
The DNS Server service does not delete every old-looking record. It checks the record timestamp, zone configuration, server configuration, and other eligibility conditions.
This distinction is important because simply enabling automatic scavenging does not guarantee that all obsolete DNS records will disappear.
4. How No-Refresh and Refresh Intervals Work
The No-Refresh and Refresh intervals are the most important settings in Windows DNS aging.
Understanding them before enabling scavenging helps prevent legitimate DNS records from being deleted.
4.1 No-Refresh Interval
The No-Refresh Interval is the period during which a DNS server does not update the timestamp of a record when it receives a refresh containing unchanged record data.
For example, assume a workstation registers:
PC01.corp.example.com A 192.168.10.20The DNS server assigns a timestamp.
During the No-Refresh Interval, the workstation may send a dynamic DNS refresh that contains the same hostname and IP address.
The DNS server acknowledges the refresh but does not update the timestamp.
This reduces unnecessary timestamp changes and Active Directory replication traffic.
However, if the client updates the record data, such as registering a new IP address, the server accepts the change and resets the timestamp.
4.2 Refresh Interval
After the No-Refresh Interval expires, the Refresh Interval begins.
During this period, the DNS server accepts timestamp-only refreshes from the client.
If the client successfully refreshes its DNS record, the timestamp is updated and the No-Refresh Interval begins again.
If the client does not refresh the record before the Refresh Interval expires, the record becomes eligible for scavenging.
4.3 Default Aging Intervals
Windows DNS commonly uses the following default values:
| Setting | Default Value |
|---|---|
| No-Refresh Interval | 7 days |
| Refresh Interval | 7 days |
| Scavenging Period | 7 days |
The No-Refresh and Refresh intervals determine when a record becomes stale.
The Scavenging Period determines how frequently the DNS server checks for stale records.
For example:
No-Refresh Interval = 7 days
Refresh Interval = 7 days
Scavenging Period = 7 daysThe record becomes stale after 14 days without an accepted refresh.
It is then deleted during a subsequent eligible scavenging pass.
With these default settings, a record can remain in the zone for up to approximately 21 days after its last accepted timestamp, depending on the timing of the scavenging schedule.
4.4 Understand the Record Aging Timeline
Consider a record registered on Day 1.
Day 1
|
| Record registered
| Timestamp assigned
|
v
Day 1 - Day 8
|
| No-Refresh Interval
| Same-data refreshes do not update timestamp
|
v
Day 8 - Day 15
|
| Refresh Interval
| Client can refresh timestamp
|
v
After Day 15
|
| Record becomes eligible for scavenging
|
v
Next eligible scavenging pass
|
| DNS record is deletedThis is a simplified example using seven-day intervals. Actual eligibility depends on the DNS server’s timestamp, zone protection time, configured intervals, and scavenging schedule.
Important: Initial Protection When Aging Is Enabled
When you first enable aging on a zone, Windows DNS gives that zone an additional protection period equal to its Refresh Interval.
This is a safety mechanism.
It allows clients to refresh records that might appear old because their timestamps were not maintained while aging was disabled.
Therefore, enabling aging does not mean that old records will immediately be deleted.
The official Microsoft explanation is available in DNS Aging and Scavenging in Windows Server.
5. Static vs. Dynamic DNS Records and Timestamps
Not all DNS records are eligible for scavenging.
Windows DNS distinguishes records using their timestamps.
Dynamic DNS Records
Dynamic records are normally registered or updated automatically by clients, DHCP servers, or other DNS update mechanisms.
They typically have a nonzero timestamp.
Example:
| Hostname | Type | IP Address | Timestamp |
|---|---|---|---|
| PC01 | A | 192.168.10.20 | 11/20/2026 10:00 |
| PC02 | A | 192.168.10.21 | 11/24/2026 14:00 |
These records can become stale if they are not refreshed within the configured intervals.
Static DNS Records
Records created manually in DNS Manager or from a zone file normally have a timestamp of zero.
Example:
| Hostname | Type | IP Address | Timestamp |
|---|---|---|---|
| DC01 | A | 192.168.10.10 | 0 |
| FILE01 | A | 192.168.10.30 | 0 |
These records are excluded from scavenging.
This behavior protects manually maintained infrastructure records from automatic deletion.
A record with a zero timestamp can still receive a dynamic data update, but its timestamp remains zero and it stays protected from scavenging.
Why This Matters
Critical infrastructure records may include:
- Domain controllers.
- DNS servers.
- Mail servers.
- File servers.
- Application servers.
- Network management systems.
- Important printers and appliances.
Administrators should know which records are static and which are dynamically registered before enabling scavenging.
Do not assume that every record in a DNS zone is safe to remove simply because it has an old-looking IP address or hostname.
For more information about the different DNS record types, see DNS Record Types Explained.
6. Prerequisites Before Enabling DNS Scavenging
Before enabling automatic cleanup, review the DNS environment.
DNS Scavenging is disabled by default, and an incorrect configuration can remove records that are still required.
6.1 Verify the DNS Server Role
Confirm that the Windows Server has the DNS Server role installed.
You can inspect installed DNS-related roles with PowerShell:
Get-WindowsFeature DNSThe DNS management tools and the DnsServer PowerShell module must also be available.
On a remote administration workstation, install the appropriate DNS Server RSAT management tools if necessary.
6.2 Identify the DNS Zones
List the DNS zones:
Get-DnsServerZoneIdentify:
- Forward lookup zones.
- Reverse lookup zones.
- Active Directory-integrated zones.
- Standard primary zones.
- Secondary and stub zones.
Aging and scavenging apply to standard primary and Active Directory-integrated zones.
Secondary and stub zones do not support these processes.
6.3 Verify the Dynamic Update Configuration
Inspect a zone’s properties in DNS Manager.
For domain-joined Windows clients, secure dynamic updates are generally the preferred configuration for Active Directory-integrated zones.
Confirm that the intended clients and DHCP infrastructure can register and refresh their records correctly.
Aging cannot compensate for broken dynamic DNS registration.
6.4 Review DHCP Lease Duration
If DHCP assigns addresses to clients, examine the lease duration and client registration behavior.
The combined No-Refresh and Refresh intervals must allow clients enough time to renew their DNS registrations.
If the intervals are too short, a device that is temporarily disconnected or has an extended lease may have its DNS record removed while it is still valid.
Do not copy another organization’s interval settings without considering your own DHCP lease policies, device behavior, and registration schedule.
6.5 Check Active Directory Replication Health
For Active Directory-integrated DNS zones, verify directory replication before changing scavenging settings.
Useful commands include:
repadmin /replsummaryAnd:
repadmin /showreplIf replication is unhealthy, resolve the existing problems before introducing DNS cleanup changes.
Also ensure that DNS servers have reliable time synchronization. Aging calculations depend on the current time of the DNS server.
6.6 Back Up DNS Zone Data
Before enabling scavenging in production, export the relevant zone data.
For example:
Export-DnsServerZone `
-Name "corp.example.com" `
-FileName "corp-example-before-scavenging.dns"The export file is created in the DNS Server’s default DNS directory unless a different supported file location is specified.
For Active Directory-integrated zones, this export is useful for troubleshooting and record review. It is not a replacement for a supported Active Directory or system-state backup.
Make sure that you have a suitable recovery plan before enabling automatic deletion.
7. Configure DNS Aging Using DNS Manager
DNS Manager provides a graphical interface for configuring aging and scavenging.
The following example uses:
DNS Server: DNS01
Domain: corp.example.comReplace these values with your actual environment.
Step 1: Open DNS Manager
On the DNS server or an administrator workstation with DNS tools installed:
- Open Server Manager.
- Select Tools.
- Select DNS.
You can also open the console directly:
dnsmgmt.mscStep 2: Select the DNS Zone
In DNS Manager:
- Expand the DNS server.
- Expand Forward Lookup Zones.
- Locate
corp.example.com. - Right-click the zone.
- Select Properties.
Step 3: Open the Aging Settings
Select the Aging tab.
Enable:
Scavenge stale resource recordsConfigure the following values:
No-refresh interval: 7 days
Refresh interval: 7 daysThese are the standard default values and are suitable as a starting point for many environments.
However, verify that they match the expected dynamic DNS refresh behavior of your clients.
Click Apply or OK to save the settings.
Step 4: Understand the Zone-Level Configuration
The Aging setting applies to the selected DNS zone.
For an Active Directory-integrated zone, the zone-level aging configuration replicates with the zone data to DNS servers that host that zone.
For a non-AD-integrated zone, configure the relevant zone on its primary DNS server.
Do not confuse this zone-level configuration with enabling automatic scavenging on the DNS server itself.
Both are required.
8. Enable DNS Scavenging Using DNS Manager
After configuring aging on the zone, enable automatic scavenging on the DNS server.
Step 1: Open DNS Server Properties
In DNS Manager:
- Right-click the DNS server name.
- Select Properties.
- Open the Advanced tab.
Step 2: Enable Automatic Scavenging
Select:
Enable automatic scavenging of stale recordsConfigure the Scavenging Period.
A common starting value is:
Scavenging period: 7 daysClick OK.
The Scavenging Period controls how frequently the DNS server performs a scavenging pass.
It does not determine when a record becomes stale. That is determined by the record timestamp and the No-Refresh and Refresh intervals.
Step 3: Configure Only the Intended Zones
Avoid enabling aging across every DNS zone without first reviewing the record contents and zone types.
DNS Manager provides an option to set aging and scavenging for all zones.
If you use this option, carefully review the setting that applies it to existing Active Directory-integrated zones.
Applying settings broadly can affect existing records and zones that were not previously configured for aging.
For production environments, a controlled zone-by-zone configuration is easier to audit.
9. Configure DNS Aging and Scavenging with PowerShell
PowerShell provides more control over DNS aging and scavenging.
The examples below use the Windows DNS Server PowerShell module.
Open an elevated PowerShell session on the DNS server or an administrator workstation with the module installed.
Import the module:
Import-Module DnsServer9.1 Check Current Server-Level Scavenging Settings
Run:
Get-DnsServerScavengingThis displays the server’s scavenging configuration.
Review:
- Whether scavenging is enabled.
- The scavenging interval.
- The refresh interval.
- The No-Refresh interval.
9.2 Check Zone-Level Aging Settings
Run:
Get-DnsServerZoneAging -Name "corp.example.com"This displays the aging configuration for the specified zone.
Confirm whether aging is enabled and review both intervals.
9.3 Enable Aging for a Specific Zone
To enable aging on corp.example.com with seven-day intervals:
Set-DnsServerZoneAging `
-Name "corp.example.com" `
-Aging $true `
-NoRefreshInterval 7.00:00:00 `
-RefreshInterval 7.00:00:00The TimeSpan format is:
Days.Hours:Minutes:SecondsTherefore:
7.00:00:00represents seven days.
9.4 Enable Automatic Scavenging on the DNS Server
Run:
Set-DnsServerScavenging `
-ScavengingState $true `
-ScavengingInterval 7.00:00:00This enables server-level scavenging and sets the automatic scavenging period to seven days.
The server-level setting does not replicate through Active Directory.
Configure it separately on every DNS server that you intend to use for scavenging.
9.5 Restrict Scavenging to a Specific DNS Server
In an environment with multiple DNS servers hosting the same zone, it is often easier to designate one server to perform scavenging.
For example:
Set-DnsServerZoneAging `
-Name "corp.example.com" `
-Aging $true `
-ScavengeServers 192.0.2.10Replace 192.0.2.10 with the IP address of the DNS server authorized to scavenge that zone.
This restriction helps make cleanup activity easier to monitor and troubleshoot.
By default, all DNS servers hosting a zone may be authorized to scavenge it. A deliberate single-server design can reduce coordination issues.
9.6 Verify the New Configuration
Run:
Get-DnsServerScavengingThen:
Get-DnsServerZoneAging -Name "corp.example.com"Check that both server-level scavenging and zone-level aging are configured as intended.
For other DNS servers, repeat the server-level check and configuration where required.
Microsoft’s official reference includes the Set-DnsServerZoneAging and Set-DnsServerScavenging cmdlets.
10. Protect Important DNS Records from Automatic Deletion
One of the most important parts of DNS scavenging is protecting records that must remain available.
A record with a zero timestamp is not eligible for scavenging.
10.1 Protect a Record Using DNS Manager
To protect an existing record:
- Open DNS Manager.
- Select View.
- Enable Advanced.
- Expand the appropriate zone.
- Right-click the record.
- Select Properties.
- Clear the option:
Delete this record when it becomes stale- Apply the change.
Clearing this option sets the record timestamp to zero.
The record is then excluded from scavenging.
Remember that this protects the record from automatic aging and scavenging. It does not prevent an administrator or an authorized update process from deleting or modifying the record.
10.2 Create a Static DNS Record with PowerShell
When you create an A record without the -AgeRecord parameter, it receives a zero timestamp and is protected from scavenging.
Example:
Add-DnsServerResourceRecordA `
-ZoneName "corp.example.com" `
-Name "criticalhost" `
-IPv4Address "192.0.2.50"The record is created without a dynamic aging timestamp.
By contrast, including -AgeRecord assigns a timestamp:
Add-DnsServerResourceRecordA `
-ZoneName "corp.example.com" `
-Name "testhost" `
-IPv4Address "192.0.2.60" `
-AgeRecordThis makes the record eligible for aging and, eventually, scavenging if it is not refreshed.
10.3 Be Careful When Converting Existing Dynamic Records
Do not assume that a single PowerShell command can clear the timestamp of any existing resource record.
Microsoft documents that there is no dedicated cmdlet that simply clears the timestamp of an existing record.
One supported approach is to remove the existing record and re-create it as a static record without -AgeRecord.
However, this temporarily removes the DNS name and changes the record’s ownership and permissions.
In environments using secure dynamic updates, those changes can affect later client registration.
Before doing this, capture the existing record data and understand the security and registration implications.
For most administrators, using the DNS Manager record properties to protect an existing record is easier to review.
10.4 Inspect DNS Record Timestamps
Use:
Get-DnsServerResourceRecord `
-ZoneName "corp.example.com"To display the most relevant properties:
Get-DnsServerResourceRecord `
-ZoneName "corp.example.com" |
Select-Object HostName, RecordType, Timestamp, RecordDataReview the Timestamp field.
A zero or empty timestamp indicates that the record is static and excluded from scavenging.
A nonzero timestamp indicates that the record can be considered for aging, subject to the other zone and server settings.
Important: Never run dnscmd /ageallrecords as a general cleanup shortcut. It assigns timestamps to records across the zone, including manually created records that may need to remain protected.
11. Troubleshoot DNS Scavenging and Missing Records
Sometimes administrators enable aging and scavenging but notice that old records are not deleted.
In other situations, legitimate DNS records disappear unexpectedly.
Both cases require checking the full configuration rather than repeatedly running scavenging commands.
Problem 1: DNS Scavenging Is Enabled but No Records Are Deleted
Check whether scavenging is enabled on the DNS server:
Get-DnsServerScavengingCheck whether aging is enabled on the relevant zone:
Get-DnsServerZoneAging -Name "corp.example.com"Then inspect record timestamps:
Get-DnsServerResourceRecord `
-ZoneName "corp.example.com" |
Select-Object HostName, RecordType, TimestampPotential causes include:
- Zone aging is disabled.
- Records have zero timestamps.
- Records have not exceeded both intervals.
- The zone is not yet eligible for a scavenging pass.
- The server is not authorized to scavenge the zone.
- The automatic scavenging period has not elapsed.
- The zone is a secondary or stub zone.
Also remember the additional protection interval applied when aging is first enabled or its settings are changed.
Problem 2: DNS Records Disappear Unexpectedly
If valid records are deleted, review the configured intervals first.
For example, consider:
No-Refresh Interval = 1 day
Refresh Interval = 1 dayThese settings may be too short for clients that do not refresh DNS frequently.
A device can still be active while its timestamp becomes old enough to qualify for scavenging.
Review:
- DHCP lease duration.
- Dynamic DNS registration schedules.
- Client update behavior.
- DHCP DNS registration configuration.
- Server and client time synchronization.
- The actual timestamps of affected records.
Do not immediately assume that scavenging itself is malfunctioning. The intervals may not match the environment’s registration behavior.
Problem 3: Some DNS Servers Scavenge but Others Do Not
Check the server-level scavenging configuration on every DNS server.
Remember:
- Server-level scavenging is local to each DNS server.
- Zone-level aging in an AD-integrated zone replicates with the zone data.
- Scavenging authorization can restrict which DNS servers may perform cleanup.
If you want only DNS01 to scavenge corp.example.com, verify that the zone’s ScavengeServers setting allows DNS01.
Also confirm that DNS01 hosts the zone and has healthy DNS service operation.
Problem 4: DNS Records Have Old Timestamps but Remain in the Zone
An old timestamp alone is not enough to prove that the record should already have been deleted.
The server evaluates:
Record Timestamp
+ No-Refresh Interval
+ Refresh Interval
< Current Server TimeThe record must also pass the zone and server eligibility checks.
After becoming stale, it remains in the zone until the next eligible scavenging pass.
Problem 5: Active Directory-Integrated DNS Zones Are Not Scavenged
Check Active Directory replication:
repadmin /replsummaryAnd:
repadmin /showreplThen inspect the DNS Server and Directory Service event logs.
An AD-integrated zone that has not loaded or received the required directory updates may be skipped by the scavenging process.
Do not force cleanup until the zone and replication state are understood.
For related troubleshooting, see Active Directory Replication Troubleshooting.
12. Monitor Scavenging Events with Event Viewer
Windows DNS records scavenging activity in the DNS Server event logs.
This makes Event Viewer an important tool for confirming that automatic cleanup is working.
Open the DNS Server Event Log
- Open Event Viewer.
- Expand Applications and Services Logs.
- Expand Microsoft.
- Select Windows.
- Locate the DNS Server event log.
Review the events related to scavenging and zone loading.
Important DNS Event IDs
| Event ID | Meaning |
|---|---|
| 2501 | A scavenging pass ran and removed records. |
| 2502 | A scavenging pass ran but did not remove any records. |
| 4013 | DNS is waiting for Active Directory Domain Services initialization before loading AD-integrated zones. |
| 4515 | A duplicate DNS zone was detected in Active Directory. |
| 4521 | An AD-integrated zone could not be loaded. |
Event 2501 is particularly useful because it indicates that records were scavenged.
Review its details to identify which records were removed.
Event 2502 is not necessarily an error. It can indicate that a scavenging pass completed successfully but no records were eligible for deletion.
Events 4013, 4515, and 4521 are useful when investigating problems with Active Directory-integrated zones.
For these events, also inspect Active Directory replication and the Directory Service event log.
Estimate the Next Automatic Scavenging Pass
The scavenging server schedules subsequent automatic passes according to the configured Scavenging Period.
For example, with a seven-day period:
Scavenging Period = 7 daysYou can use the most recent 2501 or 2502 event as an approximate reference for monitoring the schedule.
The event timestamp represents the completion time of the pass, so it is not an exact record of the next pass’s start time.
Microsoft documents these events and scheduling behavior in its DNS Aging and Scavenging Configuration Guide.
13. Common DNS Scavenging Mistakes
Several configuration mistakes can cause unexpected DNS behavior.
Enabling scavenging without enabling zone aging. Server-level scavenging alone does not make records in an unconfigured zone eligible for removal.
Setting intervals too short. Clients that are temporarily offline or use longer registration cycles may lose valid records.
Assuming static records will be deleted. Static records with zero timestamps are intentionally excluded from scavenging.
Applying aging to every zone without reviewing records. Broad configuration changes can affect zones with different operational requirements.
Running multiple scavenging servers without coordination. Multiple independently scavenging servers can make cleanup behavior more difficult to monitor and troubleshoot.
Using dnscmd /ageallrecords indiscriminately. This can assign timestamps to important static records and make them eligible for deletion.
Ignoring DHCP registration behavior. DHCP lease policies and DNS registration schedules must be considered when selecting aging intervals.
Confusing the Scavenging Period with record age. The scavenging period controls how frequently the server checks records, not how long a record must remain inactive before becoming stale.
Ignoring Active Directory replication. In AD-integrated zones, replication health affects whether DNS updates and scavenged deletions propagate correctly.
14. Practical Configuration Example and Verification Checklist
Consider an organization with the following DNS infrastructure:
| Component | Configuration |
|---|---|
| Domain | corp.example.com |
| DNS Server | DNS01 |
| DNS Server IP | 192.168.10.10 |
| Zone Type | Active Directory-integrated |
| No-Refresh Interval | 7 days |
| Refresh Interval | 7 days |
| Scavenging Period | 7 days |
The goal is to enable automatic cleanup of stale dynamic records without deleting manually maintained infrastructure records.
Step 1: Verify the Existing Configuration
Get-DnsServerScavenging -ComputerName "DNS01"
Get-DnsServerZoneAging `
-Name "corp.example.com" `
-ComputerName "DNS01"Step 2: Export the Zone for Review
Export-DnsServerZone `
-ComputerName "DNS01" `
-Name "corp.example.com" `
-FileName "corp-example-before-scavenging.dns"Remember that this export is a troubleshooting copy, not a replacement for a proper Active Directory backup.
Step 3: Enable Zone Aging
Set-DnsServerZoneAging `
-ComputerName "DNS01" `
-Name "corp.example.com" `
-Aging $true `
-NoRefreshInterval 7.00:00:00 `
-RefreshInterval 7.00:00:00 `
-ScavengeServers 192.168.10.10Step 4: Enable Server-Level Scavenging
Set-DnsServerScavenging `
-ComputerName "DNS01" `
-ScavengingState $true `
-ScavengingInterval 7.00:00:00Step 5: Review the Records
Get-DnsServerResourceRecord `
-ComputerName "DNS01" `
-ZoneName "corp.example.com" |
Select-Object HostName, RecordType, Timestamp, RecordDataIdentify important records that must remain static and verify their timestamps.
Step 6: Verify the Configuration Again
Get-DnsServerScavenging -ComputerName "DNS01"
Get-DnsServerZoneAging `
-Name "corp.example.com" `
-ComputerName "DNS01"Step 7: Monitor the DNS Server
Check the DNS Server event log for Event IDs 2501 and 2502 after scavenging passes occur.
Do not expect all old-looking records to disappear immediately after enabling aging. The initial zone protection period and the No-Refresh and Refresh intervals must be respected.
Final Verification Checklist
DNS Server role is installed and operating correctly.
The target zone is a supported primary or AD-integrated zone.
Active Directory replication is healthy where applicable.
DNS dynamic registration is working as expected.
DHCP lease and registration policies have been reviewed.
Important static records have been identified.
DNS zone data has been exported and a recovery plan exists.
Zone-level aging is enabled.
No-Refresh and Refresh intervals match the environment.
Server-level scavenging is enabled on the intended DNS server.
ScavengeServers restrictions are configured where appropriate.
Record timestamps have been reviewed.
Event IDs 2501 and 2502 are monitored.
Conclusion
Windows DNS Aging and Scavenging help administrators maintain clean and accurate DNS zones by identifying and removing obsolete dynamic resource records.
Aging tracks record timestamps and controls refresh eligibility through the No-Refresh and Refresh intervals. Scavenging periodically examines eligible zones and removes records that have exceeded those intervals.
The most important part of deploying this feature is understanding the difference between server-level scavenging and zone-level aging, reviewing dynamic DNS registration behavior, and protecting important static records.
Start with a backup and an inventory of your DNS zones. Configure aging for the intended zones, enable scavenging on the selected DNS server, and monitor the DNS Server event log to confirm that cleanup behaves as expected.
When configured carefully, DNS scavenging reduces stale records, improves DNS administration, and helps maintain reliable name resolution across Windows Server and Active Directory environments.