Manage DNS zones with Powershell
DNS forwarder setting healthcheck

To keep your environment/infrastructure clean and up-to-date, it is important to perform some healthcheck.

The following simple Powershell cmdlet will discover and test the configured DNS forwarders on your Active Directory

Get-DnsServerForwarder > Gets forwarder configuration settings on a DNS server.

Get-DnsServerForwarder
   [-ComputerName <String>]
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]

____________

If you run the previous cmdlet on one of your AD domain controller, you will get the list of your DNS forwarder.

To check if there are still alive/valid you can test the DNS port (port 53) on each of them with this mini-script

(Get-DnsServerForwarder).IPAddress | ForEach-Object { 
    Test-netConnection -ComputerName $_  -port 53 
} | ft -AutoSize
DNS forwarder setting healthcheck

Leave a Reply

Your email address will not be published.