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.

In my company we have 2 DNS servers: one for the internal hostnames and one for Internet.

I tried to configure both in my Network Manager, who result in having the two DNS server IPs in my /etc/resolv.conf.

If I put as primary DNS server the Internet one, when I try to resolve the name of one internal hostname, it fails, and the resolver doesn't try to found the IP using the secondary DNS server.

In the other hand, if I put the internal DNS as primary, I cannot reach any Internet server from my computer.

Is there a solution to make the resolver to query the seconday DNS when the first one answer with “no such name” or any other DNS lookup error?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

I guess you can use your own name server (BIND) for resolving:

zone "." IN {
    type forward;
    forward only;
    forwarders {8.8.8.8;};
};

zone "company.lan" IN {
    type forward;
    forward only;
    forwarders {192.168.0.1;};
};
share|improve this answer
    
Thanks! Probably it will make the trick for now... but what if my company have several domain suffixes? Do I need to define several zones with the same configuration? –  JoseLSegura Oct 15 '13 at 16:23
1  
Yes. You need several zone clauses for each domain. –  dchirikov Oct 15 '13 at 16:29
    
Finally I solved the issue using DNSmasq, that I have previously installed for other reason (as a little DHCP+TFTP server for PXE boot). Your help was totally necessary for investigating in the right direction. –  JoseLSegura Oct 15 '13 at 23:39
1  
@JoseLSegura How did you configure DNSmasq for that? What are the steps? –  Czarek Tomczak Dec 17 '13 at 22:39
1  
@Czarek Tomczak For separate zone dns in DNSmasq you have to add server=/company.lan/192.168.0.1 to the /etc/dnsmasq.conf –  Alexander Feb 11 at 20:12
show 2 more comments

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.