Print the BIND9 default configuration

binddefaults

Postfix has the command postconf which prints the entire Postfix configuration including its default values (default can also be shown using the -d option).

Samba has a similar command which prints the entire configuration file including its default values: testparm -v.

I'm however unable to find a similar command to print the entire configuration BIND file including its default values. I know I can look up the default values in the BIND9 Configuration Reference (Chapter 6 of the ARM) but this is tedious and the default are not easily spotted when skimming through the web page. Does this option exist for BIND?

Best Answer

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.