Share via

Need help to understand when windows laptop/pc send query to secondary DNS server configured on same nic card

umesh var 1 Reputation point
Nov 10, 2021, 10:23 AM

Hello Team,

I have one query .. when windows laptop/desktop send dns query to secondary DNS server on same nic card. In my testing i have found windows devices sending query both primary and secondary DNS server but i did not understand reason for it. If my primary DNS is live and responding then laptop should not send DNS query to secondary DNS server.

Please help ..

Windows DHCP
Windows DHCP
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.DHCP: Dynamic Host Configuration Protocol (DHCP). A communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.
1,044 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Gary Reynolds 9,506 Reputation points
    Nov 10, 2021, 12:06 PM

    Hi @umesh var

    I would have said that the secondary DNS is only used if the primary is not available, but on a Windows 10 machine, I can see the DNS request being sent to the both DNS servers when using the ping command from the command prompt.

    148201-dns-request.png

    However, if the WinSock32 gethostbyname function is used from an application it only sends a DNS request to the primary server.

    148193-dns-request-2.png

    I don't have access to a dev environment at the moment, but the DNSQueryEx function, does support the specifying of multiple DNS servers, this might cause the double DNS requests being sent.

    So I think the answer when a single or double DNS request is sent will be based on the implemetation of the name lookup function in the application. Will it cause problems, it shouldn't as both request and results will be used to the populate the local DNS client cache, and typically, the first returned result will be used. The only time it could cause inconsitencies if the the DNS servers retrun different results for the same name being queried.

    Gary.

    0 comments No comments

  2. umesh var 1 Reputation point
    Nov 11, 2021, 10:38 AM

    Thanks for your reply.

    When I did packet capture that time i saw almost every time my laptop was sending DNS query to my laptop primary DNS server and after specific period of time if does not receive response from primary DNS server then it tires to send query to second DNS server.

    I am thinking laptop wait for primary DNS server to respond and after that particular period of time send to second DNS server. Is that my understanding right ? Any timer available on DNS server we can tweak to send query to primary DNS only ?

    0 comments No comments

  3. Gary Reynolds 9,506 Reputation points
    Nov 11, 2021, 11:21 AM

    Hi @umesh var

    What you are seeing is what I would call, is how the tradition way name resolution should work, which is covered here. The request will only be sent to the secondary DNS server, if a response is not received.

    You can set the time-out on the forwarders configured on the DNS server, details can be found here

    Gary.

    0 comments No comments

  4. Limitless Technology 39,741 Reputation points
    Dec 17, 2021, 3:31 PM

    You can understand about DNS queries in the detailed article below:

    https://support.microsoft.com/en-us/topic/dns-queries-fail-on-secondary-dns-server-running-windows-server-2012-r2-or-windows-server-2012-307f36bf- 0470-3367-710c-87ae46307fb8

    You can also consult the article below which will address a problem similar to yours, I believe it may be useful:

    https://learn.microsoft.com/en-us/answers/questions/590134/primary-secondary-dns-configured-but-only-primary.html

    ------

    --If the answer is helpful, please vote positively and accept the answer.--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.