I am trying to get a solid understanding of exactly how a Windows client works with DNS. For example, lets say that I configure a network adapter with a primary and a secondary DNS server.

How long does it take to fail over and start using the secondary DNS server if the primary DNS server fails?

What is required for it to start using the primary DNS server once the primary DNS server comes back online? Will this eventually happen automatically?


If a query to your primary DNS server results in something analogous to host-not-reachable then the client resolver will automatically try the same query against the next DNS server, and so on until it either successfully contacts a DNS server or runs out of servers to try. So essentially it takes as long to fail over to the secondary server as it does to time out a connection to the first.

I believe the Windows resolver will then continue to use whichever server answers for a period of 15 minutes (or until the TCP/IP stack is reset via a reboot or something) and then will start over again at the top of the list.

Note that this failover only happens when a server is not reachable, not when the queried record is not resolvable. If the primary server can be reached but responds with a no-such-host answer then the failover does not occur.

Here's a KB article that mentions the 15 minute thing for XP.


There's a good series of flowcharts on the low-level behaviour of the Windows XP DNS client here: http://technet.microsoft.com/en-us/library/bb457118.aspx

I'm not finding the same level of documentation for the Windows Vista and newer resolvers, though I'd expect that it's in the resource kit (since those get rev'd for each new release of Windows).

(I am simplifying this a little bit... you really should read the article if you want to know how it actually works because the logic is a bit complicated.)

The XP DNS client attempts each name resolution request through the primary DNS server specified on the primary network adapter first. If that times out (in one second) it attempts the same query on each adapter in the machine using the primary DNS server specified on each adapter, all at once, waiting 2 seconds for each response. If there's no response there then it sends out a request to all DNS servers specified on all adapters and waits 4 seconds. It does this again, waiting 8 seconds, and then returns timeout if it still hasn't received a response (and will continue to return timeout for the next 30 seconds w/o issuing any new queries).

I doubt the resolver has changed much in Vista and newer OS's, but there may be some minor differences.

Interestingly, the resource kit makes no mention of the behaviour that Squillman's linked KB article describes. I'd be willing to bet that it's an ommission on the part of the resource kit.

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.