Using Windows 7 Pro here.

I have my LAN network adapter with DNS server (Google's DNS). I also have OpenVPN client to connect to my company's network.

If I type "nslookup" while disconnected from the VPN, I get (from my LAN network adapter). If I type "nslookup" while connected in the VPN, I get the DNS IP from my company's network.

That makes me think that when connected to the VPN all DNS's resolution are routed first to my company's DNS.

How can I change this order, and make the DNS resolution be routed to first, when I'm connected to the VPN?

Thank you


Found it. Network and sharing centre -> Change adapter settings -> Advanced -> Advanced settings -> move your connections up and down in the first/upper box.

| improve this answer | |
  • 3
    I think you may find that after doing this, you will no longer be able to access company resources. When you set the Primary DNS to Google, all DNS requests will be sent to Google first, and only to the second one when Google doesn't respond. For internal resources, Google will not have a record, and will respond that it doesn't have the record. Windows will not then do a request to the corp DNS. DNS resolution doesn't work that way. Test! – dunxd Aug 7 '12 at 10:21
  • 1
    dunxd this worked great in Windows 7, hardest part was finding the Advanced because the menu bar is turned off by default! – Phil Lawlor Jul 13 '17 at 14:06

Okei, i had exatcly the same problem. I've spent a day trying to figure out. Now i know and it works like a charm.

If you have several Network cards and if if specify DNS server in easch of them . Do you know what DNS server will be used at last ?

Well you can check it via practice.


So you see the server that your pc actually use

Okei. The question is - From what depends what DNS server windows choose to use and how we can change it.

We especially need it when we use VPN clients.

The answer from qwerty2010 is right and correct. But you can use it ONLY when you have NIC in control panel - network and sharing center - change adapter settings - list of nics

Only if you see the nic that is reponsible for your VPN client you can use graphical way to point windows what dns server (that is specified on a particular nic) you'd like to use.

So you go Network and sharing centre -> Change adapter settings -> Advanced -> Advanced settings -> and you move UP the nic with DNS you'd like to USE. (UP you need to lift it UP).

However if for instance you use Shrew vpn client - you will not have any nics.

What do you do.

You open registry.


And you look in subfolders 0000, 0001 etc the folder with

DriverDesc = Shrew Soft Virtual Adapter

fine. Then you copy to the clipboard

NetCfgInstanceId = {B498E7DE-7257-48F6-AD32-60E470030F05}

Now you go


and you open

key = Bind. You'll see the list like this









All you have to do is put to the top










That's all. There is no need to reboot.

Now your windows will use DNS specified in shrew vpn nic when you use vpn connection.


| improve this answer | |

This document at http://vouters.dyndns.org/tima/Windows-Unix-OpenVMS-DNS-Comparing_DNS_search_order_between_operating_systems.html addresses issues with host names resolution order on Windows 7/Linux/OpenVMS.

It is directly related to the DNS subject.

| improve this answer | |
  • 2
    Welcome to Server Fault! Generally we like answers on the site to be able to stand on their own - Links are great, but if that link ever breaks the answer should have enough information to still be helpful. Please consider editing your answer to include more detail. See the FAQ for more info. – slm May 8 '13 at 8:46

Your Answer

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