forwarding a subdomain

Kevin Darcy kcd at
Wed Nov 17 01:09:44 UTC 2004

Edward Buck wrote:

>Hi there,
>I'm trying to setup a subdomain via forwarding and I'm seeing some 
>unexpected behavior (unexpected for me, not necessarily for bind or 
>you).  Here's the scenario:
>I have a public nameserver, i.e., which is authoritative 
>for  In the zone file for, I've delegated a 
>subdomain to another nameserver by doing:
>sub      IN NS
>ns1-sub  IN A  ; public ip
>Now, on, I've configured bind with the following zone:
>zone "" {
>         type forward;
>         forward first;
>         forwarders {
> port 10053; // private ip
>         };
>The host above is on a private network accessible to ns1-sub 
>but not to the general public.
>The goal is to have ns1-sub resolve all queries for the subdomain 
> by forwarding each request to the internal server at 
>Now, here's what I don't understand.  If I query ns1-sub directly for a 
>host in (i.e., the forwarding works 
>as expected.  If I query ns1-sub using a different nameserver (i.e. from 
>my ISP nameserver), the query works ONLY If ns1-sub has cached the data. 
>  If it's not in the cache, there's no answer.  This suggests that the 
>forwarding doesn't work for recursive queries.
>Can anyone explain to me if this is normal behavior?  I'm guessing that 
>it has something to do with authoritative/non-authoritative answers and 
>possibly subdomain delegation issues but I'm stumped.  
No, it's more likely that you have recursion turned off globally -- a 
standard configuration for an authoritative-only nameserver. Forwarding 
is a form of recursive resolution, so recursion needs to be enabled in 
order for it work. You can re-enable recursion on a per-zone basis using 

By the way, does this nameserver have any way to retrieve data for names other than by forwarding? If not, then you 
shouldn't specify "forward first". "Forward first" is an opportunistic 
form of forwarding which will fall back to iterative resolution if the 
forwarder is unavailable. It should only be used as a performance 
optimization (which is rarely effective), not in situations like yours, 
presumably, where the answer is *only* available through forwarding.

- Kevin

More information about the bind-users mailing list