---
title: "Forwarding DNS queries from a caching name server to another server"
slug: "aa-00302"
description: "Forwarding can be configured globally and per-zone."
updated: 2018-10-12T20:56:44Z
published: 2018-10-12T20:56:44Z
stale: true
---

> ## Documentation Index
> Fetch the complete documentation index at: https://kb.isc.org/llms.txt
> Use this file to discover all available pages before exploring further.

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

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; };
};
```
