Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

share|improve this answer

Your Answer


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.