Bind Sub-Domain Zone Forward

binddomain-name-systemforwardinginternal-dns

I'm wanting to host DNS for a domain while forwarding a subdomain to another server.

Something like this:

zone "xxx.test.com" in {
type forward;
forward only;
forwarders { public-ip-here; };
};

zone "test.com" in {
type master;
file "domain/test.com";
};

From what I can tell, if I do this, the forward never actually happens. I'm not sure if the less specific test.com is somehow overriding it or if what I'm looking to do just needs to be done differently.

I'm running BIND 9.9.5-9+deb8u9-Debian (Extended Support Version) on both systems.

Best Answer

If you are master for the parent zone, then you should probably be setting up a delegation for the child zone, not trying to forward.

Do do a delegation just put something like this in the test.com zone.

xxx.test.com. IN NS servername.