In an Active Directory environment, it is best practice to enable DNS Aging and Scavenging. Aging and Scavenging will ensure that old DNS entries (such as decommissioned servers or computers) are deleted regularly. You will find this option by opening the properties in DNS Manager under the advanced tab or in the properties of a Forward Lookup Zone.
For detailed information, check out https://www.windowstechno.com/dns-aging-and-scavenging/.