AutomoxAutomox

Worklet: Update DNS entries on Windows

vienna
March 15, 2021 at 5:56 pm UTC

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:

1 line
Exit 0

Remediation:

powershell2 lines
Set-DnsClientServerAddress -InterfaceAlias "Ethernet*" -ServerAddresses @("8.8.8.8","1.1.1.1")
Get-DnsClientServerAddress -InterfaceAlias "Ethernet*" | Select InterfaceAlias,ServerAddresses

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack

Replies (1)

AndreyMay 5, 2021
#1

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