Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

## resolv.conf ##
nameserver 192.168.10.1   # msdns, non-recursive
nameserevr 8.8.8.8        # 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 at 16:36
    
@Barmar Yes, typo. –  Jason Caldwell May 7 at 10:52

3 Answers 3

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:

forward-zone: 
    name: "example.com"
    forward-addr: 192.168.10.1

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

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

nameserver 127.0.0.1

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

https://fedoraproject.org/w/index.php?title=Changes/Default_Local_DNS_Resolver

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

 
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.