I often stumble across the DNS_PROBE_FINISHED_NXDOMAIN error when I try to load a website.

I can solve it to manually specify the DNS servers, using for example one of Google's public DNS server addresses like, or pick an OpenDNS address. After applying those settings, things work fine again.

But at my school they run their own DNS servers or something (I don't know exactly how it works), and they apparently disallow me to use my manually specified public DNS addresses. So I have to change my settings back to 'Automatically assign DNS servers'.

So everytime I am at school, I have to revert my settings, and when I'm not at school, I have to manually re-specify those public DNS server addresses.

  • Is there a way to assign IP settings only when I'm connected to a specific router or network? If yes, how do I do that?
  • Is there another way to tackle the problem?

PS: I'm running Windows 10 (64bit, but does that matter?).

  • You failed to mention your OS
    – Tyson
    Sep 14 '15 at 13:34
  • @Tyson Good point.
    – MC Emperor
    Sep 14 '15 at 13:44
  • I am shocked that Windows still doesn't provide per-network connection settings that iOS, Android, MacOS, and Linux have had for yonks.
    – qasdfdsaq
    Sep 14 '15 at 15:06
  • @qasdfdsaq Yep! Windows is shocking. Most people are forced to use it. ;-)
    – MC Emperor
    Sep 14 '15 at 16:23

Windows uses DNS servers in the order you wrote them in. It asks the second DNS server only when it cannot reach the first one (and so on). Therefore my suggestion is: Ask the IT people in your school for the adresses of their DNS servers and type them in as first. Then, add your preferred home DNS server as second/third. It will ask those when the computer is not in the school network.

  • Yep, that does the trick. It seems that in Windows, there is no per-network option to configure these settings.
    – MC Emperor
    Sep 15 '15 at 13:09

I don't know an automatic way but you can create two cmd files. First one that contains this:

netsh interface ipv4 set dns name="Wireless Network Connection" source=dhcp

And then the second one with this line:

netsh interface ipv4 add dnsservers name="Wireless Network Connection" address= index=1

I have assumed you're using ipv4, if not change it to 'ipv6'. I have also used the default name for the WiFi, if this is different you can replace it with whatever this commands shows you:

netsh interface show interface 

This requires elevation so you have to do this for both files:

1) Make a shortcut to the .bat file
2) Rightclick the shortcut
3) select the Shortcut tab
4) Click Advanced
5) Tick the 'Run as administrator'

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.