named-checkconf(1)
Check the syntax and validity of a BIND named configuration file.
Synopsis
named-checkconf [-h] [-v] [-j] [-t directory] [configfile]Description
named-checkconf checks the syntax of a named configuration file without starting the BIND DNS server. It verifies that the configuration is valid before applying it in production, helping catch errors that would otherwise cause named to fail on startup.
If no configfile is specified, named-checkconf defaults to /etc/bind/named.conf or the system default location. The command performs comprehensive validation including zone file references, ACL definitions, and option consistency.
Common options
| Flag | What it does |
|---|---|
-h | Print a short help message and exit |
-v | Print version information and exit |
-j | Read the configuration file and print it in JSON format (for programmatic parsing) |
-t directory | Set the root directory used for relative file paths in the config (like chroot) |
-x | Read the configuration file and print it in expanded XML format |
-z | Check zone files for syntax errors in addition to named.conf |
Examples
Check the default named configuration file for syntax errors
named-checkconfExplicitly check the specified configuration file
named-checkconf /etc/bind/named.confValidate named.conf syntax and also check all referenced zone files
named-checkconf -z /etc/bind/named.confCheck configuration using /var/cache/bind as the root directory for relative paths
named-checkconf -t /var/cache/bind /etc/bind/named.confCheck config and output as JSON, then extract the directory option with jq
named-checkconf -j /etc/bind/named.conf | jq .options.directoryCheck config and print a message only if syntax is valid (exit code 0)
named-checkconf /etc/bind/named.conf && echo 'Config OK'