I want to forward all DNS queries from my caching nameserver to another server but configure exceptions for some domains - how?
  • 12 Oct 2018
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

I want to forward all DNS queries from my caching nameserver to another server but configure exceptions for some domains - how?

  • Dark
    Light
  • PDF

Forwarding can be configured globally and per zone. This is useful where the global policy differs from the configuration required for some of the zones hosted or handled by the nameserver. Many combinations are possible, including no global forwarding except for that configured for specific zones. Similarly it's possible to configure global forwarding but disable it for select zones.

The example below shows a global forwarding policy coupled with special handling for rbldnsd:

options {
        forward only;
        forwarders { <ip.of.primary.nameserver>; };
};

zone "sbl-xbl.spamhaus.org" {
        type forward;
        forward only;
        forwarders { <ip.of.rbldns.server> port 530; };
};

zone "list.dsbl.org" {
        type forward;
        forward only;
        forwarders { <ip.of.rbldns.server> port 530; };
};