From: Evan Hunt Date: Tue, 3 Jun 2025 19:45:06 +0000 (+0000) Subject: new: usr: Add support for zone templates X-Git-Tag: v9.21.9~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93c44ba551c7d51a5a70ef508f2f407e2f017783;p=thirdparty%2Fbind9.git new: usr: Add support for zone templates To simplify the configuration of multiple similar zones, BIND now supports a zone template mechanism. `template` blocks containing zone options can be defined at the top level of the configuration file; they can then be referenced in `zone` statements. A zone referencing a template will use the options in the specified `template` block as defaults. (Options locally defined in the `zone` statement override the template.) The filename for a zone can now be generated parametrically from a format specified in the `file` option. The first occurrences of `$name`, `$type` and `$view` in `file` are replaced with the zone origin, the zone type (i.e., primary, secondary, etc), and the view name, respectively. Primary zones can now take an `initial-file` option, specifying the path to a generic zone file that will be copied into the zone's `file` path when the zone is first loaded, if the `file` does not already exist. For example, the following template can be used for primary zones: ``` template primary { type primary; file "$name.db"; initial-file "generic.db"; }; ``` With this template in place, a new primary zone could be added using a single `rndc addzone` command: ``` $ rndc addzone example.com '{ template primary; };' ``` The zone would be created using the filename `example.com.db`, which would be copied into place from `generic.db`. Closes #2964 Merge branch '2964-zone-templates' into 'main' See merge request isc-projects/bind9!10407 --- 93c44ba551c7d51a5a70ef508f2f407e2f017783