2

Using Windows 7 Pro here.

I have my LAN network adapter with DNS server 8.8.8.8 (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 8.8.8.8 (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 8.8.8.8 first, when I'm connected to the VPN?

Thank you

4

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

  • 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
  • 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
1

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.

nslookup

192.168.3.6

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.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4D36E972-E325-11CE-BFC1-08002BE10318}

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

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Linkage]

and you open

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

\Device{1DF89CE3-CAAD-4EB7-A53F-AD16BC1D5EFD}

\Device{70126DBE-B44D-4392-9417-0CABD6E384B1}

\Device{D5127F8E-E7BB-4661-AE5A-A922614173D0}

\Device{C44039AB-6801-4A9B-A736-3B12782FF411}

\Device{85231D0F-CD05-4774-A983-632C5D83AC62}

\Device{7E87BC81-8C58-4E05-9FA0-7897A6AA5CCE}

\Device{3A1A3EFC-A9DE-4BCA-BAF6-81C7074487E0}

\Device{8D41EDFC-04AC-4537-B5D5-0D54EB51A023}

All you have to do is put to the top

\Device{B498E7DE-7257-48F6-AD32-60E470030F05}

\Device{1DF89CE3-CAAD-4EB7-A53F-AD16BC1D5EFD}

\Device{70126DBE-B44D-4392-9417-0CABD6E384B1}

\Device{D5127F8E-E7BB-4661-AE5A-A922614173D0}

\Device{C44039AB-6801-4A9B-A736-3B12782FF411}

\Device{85231D0F-CD05-4774-A983-632C5D83AC62}

\Device{7E87BC81-8C58-4E05-9FA0-7897A6AA5CCE}

\Device{3A1A3EFC-A9DE-4BCA-BAF6-81C7074487E0}

\Device{8D41EDFC-04AC-4537-B5D5-0D54EB51A023}

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.

-

0

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.

  • 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