Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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: 8.8.8.8) 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?

share|improve this question
add comment

1 Answer

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 192.168.0.200

taken from and more info available here

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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