I have a Windows 7 Pro box with a curious problem regarding DNS server use.

The box is assigned an IP address and 2 DNS servers from a Linux-based DHCP server on my local network. The 2 DNS servers my local DNS server (for private hosts), and my ISP's DNS server for redundancy should my in-house DNS fail.

Although IPCONFIG on Win7 shows the DNS addresses are properly issued, resolution isn't working as I expect. When attempting to launch a page from an internal webserver via hostname, the Win7 browsers (Chrome, IE) say they cannot resolve the address. A netmon trace shows that Windows is actually forwarding the DNS request directly to the ISP's DNS, and never to my network's local DNS server. It should always try the local DNS server first. Oddly, when using nslookup, resolution works as expected (local first).

I'm assuming, perhaps incorrectly, that the DNS servers issued by DHCP would be used in order, meaning the local DNS would always be the server of first choice. Is this not correct?

In researching this, I've read of some problems very similar to this are usually tied to a solution that addresses the manual configuration of the order in which DNS servers should be used, which seems to me to defeat the convenience of DHCP.

Is there an IP/registry setting in Windows 7 that would force it to use DNS servers in the order specified by DHCP?

Many thanks in advance.

  • Do you have any idea how Windows is getting the IP address of your ISP's DNS server? Are there any routers on your LAN using UPnP? – David Schwartz Jan 11 '13 at 2:26
  • Thanks for the assist, David! The DHCP server on the Linux box is explicitly set up to provide the local DNS server and that of my ISP with the address request/renewal. – David W Jan 11 '13 at 2:43
  • Then the system is free to use either of them. – David Schwartz Jan 11 '13 at 5:04
  • But there's obviously a priority assignment capability - if I were to assign them manually. I wouldn't think that ability is discarded merely for having the DNS addresses assigned by DHCP. From a network admin side, I want to be able to control which DNS servers are used by various hosts on the network, wouldn't I? – David W Jan 11 '13 at 16:17
  • I don't believe there's any support for strict priority, that is, a rule that one may not be used unless the other fails. – David Schwartz Jan 11 '13 at 18:51

Basic Setup

If I remember correctly, DNS entries are treated as equal. If windows fail to connect to one of them, the other one will be use. So a "host not found" reply from one dns WILL NOT make windows to ask the other one. That reply is a successful connection. DNS lookup stop at that point.

In your situational the dns and dhcp SHOULD be setup as follow:

  1. DHCP only assign internal DNS
  2. Internal DNS will resolve both internal and internet addresses.

BIND9 by default should resolve base on local zone files first, then query top level domain(if the box is able to access internet). You can test that from your windows box by doing the follow

> server <IP of your internal dns box>
> <internal hostname>
> google.com

Bind should be able to resolve both internal hostname and google.com.

If you want to make use of your ISP dns, put it in the forwarding section. It should be in /etc/bind/named.option.

Dual/Backup DNS

When providing multiple dns servers, either manually or via dhcp, the client machine treat them equally. There is no "primary" or "secondary". This is same for both windows and linux.

To provide redundancy the "easy" way is to setup 2 internal dns, while one can be master and the other one slave. That way only one need to be update. DHCP will provide the IP of these 2 dns servers for internal use.

Regarding external dns redundancy, put multiple external dns in the forwarding section of the internal dns servers.

PS: With all the above, I am assuming you do need dns lookup for internal machines/servers. If not, it can be much more simple.

|improve this answer|||||
  • I re-read your questions and revised the answer. You properly read about prioritizing dns from this: serverfault.com/a/21486/138643 . That is if you have multiple NICs and multiple networks. – John Siu Jan 14 '13 at 2:51
  • John, thanks for taking the time to answer, and my apologies for the delay in responding. Let me clarify that my intent in prioritizing the DNS servers as described in my original post was not to cause the 2nd server to be tried if the first did not resolve. The intent was purely to provide a backup DNS server should the one designated as "primary" prove to be down or otherwise unavailable. – David W Jan 21 '13 at 20:40
  • I will update my answer. – John Siu Jan 21 '13 at 20:45

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.