Skip to main content

Hi all, in response to a users query on here I thought I’d post a quick and easy way to update your primary and secondary DNS entries on your devices. Be sure to amend the “Ethernet*” in -InterfaceAlias to target your desired network adapters and edit the “8.8.8.8”,“1.1.1.1” to your specified DNS servers



Be sure to test first, this will also output those amended network adapters to your Reports > Activity log



Evaluation:



Exit 0



Remediation:



Set-DnsClientServerAddress -InterfaceAlias "Ethernet*" -ServerAddresses @("8.8.8.8","1.1.1.1")

Get-DnsClientServerAddress -InterfaceAlias "Ethernet*" | Select InterfaceAlias,ServerAddresses

Or use Interface Index parameter - Set-DnsClientServerAddress -InterfaceIndex 3 -ServerAddresses (“8.8.8.8”, “1.1.1.1”)


Reply