Submitted By: Anonymous Submission

Sets or changes the DNS Server of the named Ethernet connection (for example, Local Area Connection). Script can be run using PSTools PSEXEC ("\psexec.exe @DNSServers.txt -c -s change_dns.bat"). Great for changing DNS settings on multiple servers.

Visual Basic
netsh interface ip set dns "Local Area Connection" static 	(Set to your Primary DNS Server)
netsh interface ip add dns "Local Area Connection"		(Set to your Secondary DNS Server)
netsh interface ip set wins "Local Area Connection" static	(Optional..Set to WINS Server)