Print the BIND9 default configuration
No, there is no tool/option that really does what you want.
named-checkconf -p
prints the full user configuration but does not show the full effective configuration (including defaults).
You can find the default configuration for options
in bin/named/config.c
in the BIND codebase, BUT some configuration parameters are interdependent, where overriding one affects others as well (see eg allow-query
and allow-recursion
), so the effective configuration is not as simple as just overlaying the user configuration on top of the default config without additional logic.
I agree that it would sometimes be useful to have a tool that would print the full effective configuration as named
would use it, but there just isn't any option for that currently.
The best readily available suggestion I can offer is searching for default in your browser before you start reading through the options in the manual to get every instance of this word highlighted, making it easier to spot the default values as you go along.
The BIND configuration is little more complex than just a list of option/value pairs that can have default values which are then altered. Configuration can also be split to several files through include
s.
The similar syntax checking tool and the command you are looking for is named-checkconf
:
named-checkconf
checks the syntax, but not the semantics, of anamed
configuration file. The file is parsed and checked for syntax errors, along with all files included by it. If no file is specified,/etc/named.conf
is read by default.Note: files that
named
reads in separate parser contexts, such asrndc.key
andbind.keys
, are not automatically read bynamed-checkconf
. Configuration errors in these files may cause named to fail to run, even ifnamed-checkconf
was successful.named-checkconf
can be run on these files explicitly, however.
While named-checkconf
reads through named.conf
and the all the configuration files included, another tool, named-checkzone
checks the syntax and integrity of a zone file.