You get a bonus - 1 coin for daily activity. Now you have 1 coin

Windows Server: automatic cleanup of stale records on a DNS server

Practice



A common occurrence for a Windows domain - computers joining the network automatically register their A records (and, where possible, PTR records) on the DNS servers (which, as a rule, also double as domain controllers). This makes it easy to find a computer by its name regardless of which subnet that computer is in.

As long as the computer stays on the network and keeps its record up to date - everything is fine. But then you rename its hostname, reinstall the OS on it, or simply decommission a piece of hardware that has served its time. What happens? The DNS record for that computer name remains registered on the DNS server.

Moreover, even if another computer appears with the same IP address, it won't notice that the same IP is still referenced by some other A record (it just won't be able to create a PTR record, but that usually bothers neither the operating system nor the administrator).

How do you deal with this? Relatively simply - you can set an interval after which unrefreshed records on the Windows DNS server will simply be deleted. This way, old, no-longer-valid entries will be cleaned up.

Of course, this will take some time (the amount you specify yourself). I.e., a record won't automatically disappear the moment you do something with the computer - the aging period you specified must pass before the DNS server realizes that a computer with that name no longer exists.


So, let's set this option for Windows Server DNS servers.


1) Open the DNS server snap-in

Start -> Administrative Tools -> DNS


2) Select the required server (by default, only the local server is present in the list)

3) Right-click this server and select "Properties"

4) Go to the "Advanced" tab

5) Enable the "Enable automatic scavenging of stale records" option

6) Set the "Scavenging period".

Note. The default value of "7 days" is quite short. I personally settle on a value of 30 to 45 days.

7) Click "OK". That's it.

Now, once the specified period has elapsed, if a zone has not been refreshed, it will be automatically removed from the DNS server. Since Windows computers periodically poke the DNS server and refresh their zones, active records will stay alive while stale ones will be removed.

Applies to: Windows Server 2003/2008

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Computer networks"

Terms: Computer networks