Tip: Change DNS Server for a Network Adapter via Command Line in Windows

Just a quick tip/note on changing the DNS server(s) for a network adapter in Windows from the command line.
To do this, you need elevated privileges on a command line (or you can use ‘runas’ from a non-elevated command line and provide administrative credentials).

c:>netsh interface ip set dns "Local Area Connection" static 8.8.8.8

To set it via DHCP you can just issue:

c:>netsh interface ip set dns "Local Area Connection" dhcp

Published by

Rich

Just another IT guy.

Leave a Reply

Your email address will not be published. Required fields are marked *