What Was I Thinking?

Follies & Foils of .NET Development
posts - 95 , comments - 352 , trackbacks - 0

Thursday, March 1, 2012

Specifying DNS Servers at the command prompt

Did you know you can set your DNS Servers from the command prompt using the NETSH command (available in win 2003 and later)?

You can even specify the order in which the servers are registered in the DNS lookup

netsh interface ip set dns "Local Area Connection" static 8.8.8.8
netsh interface ip add dnsservers "Local Area Connection"  8.8.4.4 index=2
netsh interface ip add dnsservers "Local Area Connection" 10.0.8.100 index=3

If you want to configure DNS to use DHCP:

netsh interface ip set dns “Local Area Connection” dhcp

if you want to clear the table entirely:

netsh interface ip set dns “Local Area Connection” address=none

 

You’ll need to replace “Local Area Connection” with your LAN Connection name, should it differ.

Posted On Thursday, March 1, 2012 4:02 PM | Comments (0) | Filed Under [ General Geekiness ]

Powered by: