Netsh script to change to OpenDNS on the fly

Netsh script to change to OpenDNS on the fly

Sometimes it easier to send a script to an IT illiterate than to explain how to do configure stuff in Windows. The script below replaces a ISP’s DNS adresses with OpenDNS entries for the windows user making it much easier for you:

@echo off
rem Adjust the IFACE variable below to the name of the network interface on your system.
set IFACE=Local Area Connection
echo Old DNS:
netsh interface ip show dns
netsh interface ip set dns "%IFACE%" static 208.67.222.222 > NUL
netsh interface ip add dns "%IFACE%" 208.67.220.220 > NUL
echo OpenDNS (Hopefully):
netsh interface ip show dns
echo This window will close in 10 seconds. Please check above if DNS entries have been changed.
rem for /L %%i in (1,1,10) do sleep 1 && (echo|set/p="%%i..") (unrem if there you have sleep.exe)
timeout /T 10