How can I check the default option values in named.conf?
  • 12 Oct 2022
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

How can I check the default option values in named.conf?

  • Dark
    Light
  • PDF

Article Summary

There wasn't any command for BIND 9 that would list all named.conf options and their default settings, but checking the defaults can sometimes be helpful in understanding why BIND is doing something that you didn't expect it to, particularly if you've recently upgraded.

From versions 9.18.3 (and backported to 9.16.29) a new switch is available for named; -C. Here is a sample of the output it produces:

%named -C
# Built-in default values. This is NOT the run-time configuration!
options {
.

All commands and options are documented in the Administrator Reference Manual for the version of BIND that you are running. The ARM can be found in the following places:

  • The source code tarball (in the /doc/arm directory)
  • In the appropriate folder in the BIND 9 directory on ISC's downloads site: https://downloads.isc.org/isc/bind9/.
  • Read the Docs for the latest version. Or..
  • Read the Docs for a specific version, using the underscore character as a numeric separator. For example, this is the page for the ARM relating to version 9.16.33.

In addition, if you download and build source, there's a tool that will print all the supported options (although it doesn't print the default settings):

bin/tests/cfg_test --named --grammar

But if you've downloaded the source anyway, the defaults for nearly every option are set in /bin/named/config.c -- scroll down to where it says "default configuration" and read from there. For example:

options {\n\
#       blackhole {none;};\n"
#ifndef WIN32
"       coresize default;\n\
        datasize default;\n\
        files default;\n\
        stacksize default;\n"
#endif
"       deallocate-on-exit true;\n\
#       directory <none>\n\
        dump-file \"named_dump.db\";\n\
        fake-iquery no;\n\
        has-old-clients false;\n\
        heartbeat-interval 60;\n\
        host-statistics no;\n\
        interface-interval 60;\n\
        listen-on {any;};\n\
        listen-on-v6 {none;};\n\
...

/bin/named/config.c also includes defaults for 'view' and 'zone'.