3

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?

1 Answer 1

4

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;};
};
7
  • 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? Oct 15, 2013 at 16:23
  • 1
    Yes. You need several zone clauses for each domain.
    – dchirikov
    Oct 15, 2013 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. Oct 15, 2013 at 23:39
  • 1
    @JoseLSegura How did you configure DNSmasq for that? What are the steps? Dec 17, 2013 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, 2014 at 20:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .