How can I change/switch my DNS server IP address by a registry script?

For example, I want to change to Google DNS Server (IP: often and when I need to check my internet usage I need to switch back to the default service provider's DNS Server.

So I need to create two reg scripts one for setting the DNS to nil (Default) and the other for changing it to google DNS.

Any idea?


Rather than using a .reg file you can use the NETSH command line util, e.g.

netsh interface ip set dns "Local Area Connection" static

taken from and more info available here

You can then create .bat files with the 2 different settings you want

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.