18

In dnsmasq, it's possible to forward domains to different nameservers. How can I do that in named?

server=/foo.com/10.0.10.1
server=/vpn.foo.com/8.8.8.8
18

This should work for BIND9:

zone "foo.com" IN {
    type forward;
    forwarders {
        10.0.10.1;
    };
};

zone "vpn.foo.com" IN {
    type forward;
    forwarders {
        8.8.8.8;
    };
};
  • You might also need to replace dnssec-validation auto; with dnssec-validation no; in named.conf.options. – mivk Dec 30 '13 at 17:12
  • 1
    Does this also supports wildcards? – petersaints Aug 24 '15 at 18:52
  • The BIND 9.9 Configuration Reference doesn't explicitly say, but since the zone name needs to be a valid zone that could be used with the $ORIGIN directive in a zone file, I don't believe you can use wildcards for the zone name. – James Sneeringer Aug 24 '15 at 19:22
  • 3
    Also a forward only option might be meaningful here. – Dmitri Chubarov Nov 9 '16 at 7:48

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.