Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 11 down vote accepted

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.

share|improve this answer
    
Thanks.. The "15 Minutes" gave me the last search term I needed to find this technet article that corroborates your answer. Much appreciated! support.microsoft.com/kb/320760/en-us –  Andy Schneider Aug 11 '09 at 20:54

Is it possible to change the settings for a switch/failover from primary DNS to secondary DNS? I know the default criteria for switching is when the server is "unreachable" and not when the name is unresolvable.

I am trying to setup my machine so it uses an external DNS as a primary but when it fails to resolve ip addresses of internal server names it should use the secondary DNS which is an internal server?

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.