How to check or uncheck boxes to delete stale Record DNS

Mohamed SAKHO 116 Reputation points
2022-02-14T14:11:49.477+00:00

Hello,

In order to control the DNS Scavenging, I would like to enable the feature in my DNSZone on a group of devices (approximately 1000 records).
Please my question is how to uncheck the box "Delete this record when it becomes stale" (see attachement) on all of my record by using powershell or how to let this box checked only on targeted devices identyfied in csv or txt file.
Thnak you by advance

174038-royal-ts.png

Mohamed

Windows DHCP
Windows DHCP
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.DHCP: Dynamic Host Configuration Protocol (DHCP). A communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.
1,039 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,544 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Rich Matheisen 46,801 Reputation points
    2022-02-14T16:12:38.097+00:00

    Use the Set-DnsServerResourceRecord cmdlet and remove the expiration timestamp from the resource records.

    0 comments No comments

  2. Limitless Technology 39,661 Reputation points
    2022-02-18T14:34:29.783+00:00

    Hello @Mohamed SAKHO

    You can use the next command:

    dnscmd /Config domain.com hostname /ScavengingInterval 0   
    

    (zero will disable)

    Reference and examples: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc771570(v=ws.11)?redirectedfrom=MSDN

    Hope this helps with your query,

    -------
    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  3. Mohamed SAKHO 116 Reputation points
    2022-02-24T17:04:29.057+00:00

    Hello @Limitless Technology ,

    Thank you for your answer, but your command doesn't works when I try to launch it.
    We can't put a host name after ce dns zone name. This command works only on the dns zone and not for a record.
    On the article you posted it is not indicate that it runs for a record.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.