Unlike static DNS records, dynamic records should not stay forever in the server. This is because dynamic DNS records can turn into stale records. This process is called aging. Stale records itself are subject for deletion in the server, and the deletion process is called scavenging. In this post, we’re going to learn the way to Configure Aging and Scavenging in Windows DNS Server. Both of these processes are important to ensure records validity and keep the DNS server healthy.
Reason to Configure Aging and Scavenging in Windows DNS Server
The reason why you should configure aging and scavenging in Windows DNS server is to get rid of the stale records. Stale records are dynamic DNS records that has already passed the aging interval. It’s never a good idea to keep stale records as they may mess up the name resolution. Wrong name resolution could lead to a bigger incident in the network and that would be a nightmare for the administrator. Keeping too many stale records on your DNS server may also impact its performance.
Please note that stale records will stay on the server if we don’t configure scavenging. Therefore, it is either the administrator who should perform manual scavenging regularly or set schedule for automatic scavenging.
How to Configure Aging Interval in Windows DNS Server
Before we continue, if you haven’t yet, you can check the other article about the concept of DNS refresh and update. It is very important to understand the concept before we configuring the aging interval.
Aging interval is actually the sum of no-refresh interval and refresh interval. No-refresh interval is a period of time given to a record before aging process started. When a refresh occur during this interval, it will not going to renew the timestamp. However, a record within the no-refresh interval is not a subject for scavenging. The default no-refresh interval value in Windows DNS server is 7 days.
On the other hand, refresh interval is a period of time to renew the timestamp of a record. If a timestamp renewal occurs due to record refresh or update during this interval, the record will re-enter the no-refresh interval from the beginning. But if there is no record refresh/update process occur during this interval, record will become stale by the end of the interval. The default refresh interval value in Windows DNS server is also 7 days.
The default value for no-refresh and refresh interval may not fit to any scenario. Administrator can change the no-refresh and refresh interval value by following the steps below:
We can configure aging on a specific zone, or on the DNS server itself. When you configure aging on the DNS server, means that it will applies to all zones in the server. In this example we configure aging on a specific zone with name mustbegeek.com. Right click on the zone name and select Properties.
On the General tab, click on the Aging button.
Aging properties window should appear. In this window, there are few things you should do:
- Tick the option to Scavenge stale resource records. Note that this does not really enabling scavenging (we still have to configure scavenging in the next section). What this option really does is allowing scavenging of stale records.
- Fill in the No-refresh interval. In this example we’re setting the no-refresh interval to 3 days.
- Fill in the Refresh interval. In this example we’re setting it to 4 days.
Now, based on the setting above, if a record will become stale if it does not getting any refresh or update after 7 days (sum of the no-refresh interval and refresh interval). This stale record is subject for deletion on the next scavenging schedule.
How to Configure Scavenging in Windows DNS Server
We can only enable scavenging on the server level to completely delete stale records. This means scavenging will be applied to all zones in the server. However, if you don’t configure aging interval on a zone then scavenging will not do anything on that zone.
Overall, scavenging is not applicable to:
- Records on a zone where aging is not configured
- Records on a no-refresh/refresh interval
- Static records who doesn’t have timestamp
The steps to apply the scavenging schedule on Windows DNS server is very easy.
On DNS Manager, right click on the server name then select Properties.
Go to Advanced tab, then tick on the option to Enable automatic scavenging of stale records. Define the scavenging period according to your needs. In below example, we set scavenging to occur every 7 days.
And that’s all you need to do to activate automatic scavenging on the server.
Both aging and scavenging must be configured on the server to get rid of stale records. Aging is basically a time interval to refresh or update a record before it becomes stale. On the other hand, scavenging is the process of deleting the stale records. We can configure scavenging to run periodically. Any record that has passed its aging interval is eligible to be deleted during the next scavenging period.
And that’s all you need to know to configure aging and scavenging in Windows DNS server.