Trying to set listening IP address on Windows DNS Server automatedand thought it would be simple to use Set-DnsServerSetting, like Set-DnsServerSetting -ListeningIPAddress $ip ..

Think again, however this works:

$DSNServerSettings=Get-DnsServerSetting -ALL
$DNSServerSettings.ListeningIpAddress=@($ip)

Set-DNSServerSetting $DNSServerSettings

So retreive the DnsServerSetting Class, change the ListeningIP and write the sh1te back works.

#powershell #WindowsServer2022 #dns #settings #listeningip #givemebind9anytime

Last updated 2 years ago