Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to resolve from a non-recursive MSDNS and if not found resolve from googleDNS (recursive)?

## resolv.conf ##
nameserver   # msdns, non-recursive
nameserevr        # googleDNS, recursive 

If I place the MSDNS first and ping someLocalServer it works, but if I ping google.com I get "unknown host". If I switch them around the opposite occurs, google pings fine, the "someLocalServer" gives me the "unknown host".

I've tried messing with nsswitch.conf but this hasn't helped.

## nsswitch.conf ##
host: file mdns_minimal dns mdns4

I've switched those tags around, file dns mdns4 [or] file mdns4 dns [or] file mdns_minimal [NOTFOUND=continue] dns ...

I have a Windows Domain and the windows DNS I've setup to be non-recursive. What I'm expecting is; if a local lookup fails, I expect the lookup to be handled by googleDNS.

This setup works fine under Windows Server but not under a CentOS basic install.

share|improve this question
BTW, the name of the file is resolv.conf -- no e before the .. – Barmar May 3 '14 at 16:36
@Barmar Yes, typo. – Jason Caldwell May 7 '14 at 10:52

resolv.conf will fallback to bottom entry only if there will be timeout or error with first one. Unknown is correct answer from dns server.

share|improve this answer

You can use the local MSDNS instance for a specific zone (domain subtree). While glibc and /etc/resolv.conf don't support it, you can install BIND, Unbound or another capable nameserver (I'm not sure about BIND, here, but then you could even reuse the existing nameserver).

With unbound, you can configure a forward zone:

    name: "example.com"

There's an example in the default unbound.conf.

Your resolv.conf would then point to localhost (or the host with the recursive server):


Linux distributions are hopefully moving towards such a solution by default, see Fedora change page:


share|improve this answer
up vote -1 down vote accepted

There doesn't appear to be a way to make this work as expected. So, what I've done instead is mark my Microsoft DNS servers as recursive and removed the forwarder entry in my second domain controller (put there by default, but causes recursive resolve delays when the first domain controller [writable controller] goes offline). Why Microsoft, why?

share|improve this answer

Your Answer


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.