Overriding Included Zone File Entries

Barry S. Finkel bsfinkel at att.net
Tue Mar 5 19:51:52 UTC 2013

On 3/5/2013 1:08 PM, Pat Suwalski<pat at suwalski.net> wrote:

> Hello everyone,
> I have a question about using the $INCLUDE directive in my zone files.
> We run DNS for a moderately large number of domains, largely pointing at
> the same servers. So, I'd really like to have the following setup:
> db.common.inc:
>       mail IN A n.n.n.n
>       mail2 IN A n.n.n.n
>       www IN A n.n.n.n
>       @ IN TXT "v=spf1..."
> And then have individual zone files be able to override the various values:
> db.special.domain.com:
>       $INCLUDE db.common.inc
>       www IN A x.x.x.x
> Of course, this just round-robins the A record for the www entry.
> Does anyone know if it is possible to make the new entry override the
> previously included one rather than add to it?
> If not, is there a typical config structure that has worked for someone
> trying to do a similar setup?
> Many thanks,
> --Pat

What you need to do is have the common piece in an $INCLUDE file
and put changed items (such as www in your example) in each view.
If www changes in each view, then do not include it in the common
file.  If, for example, you have three views, and www is the same
in two views and different in the third, then you still have to
have www in each view and not in the common file.
--Barry Finkel

More information about the bind-users mailing list