6

I have two network interfaces on my computer on my Windows PC.

Primary and Secondary DNS servers are defined per network interface so I can define 2 sets of DNS servers on two network interfaces.

When looking up for a server name, which DNS server is used and why?

1
  • Personal observation on Windows 10 using WireShark: nslookup uses the DNS server on the interface with lowest metric. Browsing (IE, Edge, Chrome) seems to trigger queries to DNS servers on both interfaces simultaneously (within 1-2 milliseconds or even faster). So be careful what you interpret from testing with nslookup alone.
    – bers
    Apr 1, 2020 at 12:57

3 Answers 3

0

As far as I know windows implements interface priority which you could alter. I think it uses the connection with the highest priority, and from there it`s DNS server.

2
  • Where can I see priorities and how can I alter them ?
    – e-mre
    May 26, 2011 at 7:24
  • Go to network connections, hit the alt key and go to advanced/advanced settings.
    – xciter
    May 26, 2011 at 12:30
0

I haven't checked this, but my assumption would be that the DNS servers defined on the interface that has the default gateway will be tried first followed by the servers on the other interface.

Easiest way to check for sure is to capture your network traffic using Microsoft Network Monitor or a similar tool.

3
  • Default gateway is also defined per network interface, so two network interfaces can have two different default gateways defined, so it must be something other than that I guess.
    – e-mre
    May 12, 2011 at 7:18
  • 1
    Capturing the network traffic would answer "which" but would not answer "why"
    – e-mre
    May 12, 2011 at 7:18
  • AFAICT Windows will try only the first DNS server. If it says "address unknown", Windows will not query other networks.
    – MSalters
    Jul 31, 2018 at 14:26
0

I found an useful article that explains what's the strategy to choose the DNS Server among multiple interfaces:

Windows uses a very complex logic for name resolution when dealing with multiple network interfaces.

The behavior can be changed from multiple points:

  1. The network adapter priorities can be managed by a parameter called the interface metric, which can be changed for each adapter through Control Panel ( Adapter->Properties->TCP/IPv4(IPv6)->Properties->Advanced->Interface metric) or Power Shell commands ( Get-NetIPInterface and Set-NetIPInterface).
  2. From the Group Policy Editor (gpedit.msc) at Computer Configuration->Administrative Templates->Network->DNS Client.
  3. From the system registry (regedit.exe): HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters Some of the parameters are: -DynamicServerQueryOrder -DisableSmartNameResolution -DisableParallelAandAAAA

All of the above parameters are independent and may interfere with one another.

To your "why" question, the logic would depend on what's best for you. For example you want that the resolution to your internal or external domains are resolved by your own DNS Servers then you will be able to monitor all DNS traffic, on the other side it could lead to privacy issues or add unwanted load to your own DNS Servers

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .