Change DNS Servers via Commandline on Windows

Posted on February 6, 2018 at 7:45 pm

Change IPv4 and IPv6 DNS servers via Windows Command Prompt on Windows:

For Windows Vista and higher (requires Admin rights)

Set IPv6 Primary DNS:

netsh int ipv6 set dns name="Local Area Network" static 2001:4860:4860::8888 primary validate=no

Set IPv6 Secondary DNS:

netsh int ipv6 add dns name="Local Area Network" 2001:4860:4860::8844 index=2 validate=no

Set IPv6 Automatic DNS (DHCP):

netsh int ipv6 set dns name="Local Area Network" dhcp

Set IPv4 Primary DNS:

netsh int ipv4 set dns name="Local Area Network" static 8.8.8.8 primary validate=no

Set IPv4 Secondary DNS:

netsh int ipv4 add dns name="Local Area Network" 8.8.4.4 index=2 validate=no

Set IPv4 Automatic DNS (DHCP):

netsh int ipv4 set dns name="Local Area Network" dhcp

For Microsoft Windows XP

Set Primary DNS:

netsh interface ip set dns name="Local Area Network" static 8.8.8.8

Set Secondary DNS:

netsh interface ip add dns name="Local Area Network" 8.8.4.4 index=2

Set DNS to Automatic (DHCP):

netsh interface ip set dns name="Local Area Network" dhcp

Show Network Interfaces

netsh interface show interface

Empty Cache

ipconfig /flushdns

Receive updates via email

Other Posts

Updated Posts