No, there is not a way to do this within named.conf
and its included files. Every zone must be explicitly defined, along with a type and data source at a bare minimum. You can have multiple zones reference the same file if the records they contain should be exact duplicates, but that is the only shortcut for this.
Other options can have their defaults set in the global options block (allow-transfer
, also-notify
, etc.), but you are stuck with defining every zone and the mandatory fields at a bare minimum.
For the sake of completeness, I'll mention one exception with newer versions of BIND that I strongly recommend against. You can use the new rndc addzone
functionality to remotely create a zone on the fly, but what this really does is create an additional configuration file with a hashed name (i.e. randomized characters in the filename) and a .nzf
suffix that BIND "knows" to load. This is very bad from a maintainability standpoint as it violates the principle of least surprise/astonishment; the main configuration file makes no reference to these additional config files and other administrators will have no idea that the contents of these files are being loaded unless they're familiar with the feature. (and very DNS admins are due to its newness)
https://ftp.isc.org/isc/bind/9.10.3rc1/doc/arm/man.rndc.html
addzone zone [class [view]] configuration
Add a zone while the server is running. This command requires the
allow-new-zones option to be set to yes. The configuration string
specified on the command line is the zone configuration text that
would ordinarily be placed in named.conf.
The configuration is saved in a file called hash.nzf, where hash is a
cryptographic hash generated from the name of the view. When named is
restarted, the file will be loaded into the view configuration, so
that zones that were added can persist after a restart.
This sample addzone command would add the zone example.com to the
default view:
$ rndc addzone example.com '{ type master; file "example.com.db"; };'
(Note the brackets and semi-colon around the zone configuration text.)
See also rndc delzone and rndc modzone.