This tutorial will guide you through the commands to change DNS remotely.
I already assume that you know Psexec and you have basic Windows networking knowledge 😉
OK. so let’s begin!
Let’s check interface names on remote machine:
psexec64 -s /user:domain\user -i \\COMPUTER_NAME cmd /c netsh interface show interface
You should get:
Now you can change primary or secondary DNS like that:
psexec64 -s /user:domain\user -i \\COMPUTER_NAME cmd /c netsh interface ipv4 set dnsservers "Połączenie lokalne" static 184.108.40.206 primary
And that’s it. Done.