nsd-checkconf
Validate and query NSD configuration filesSynopsis
Description
nsd-checkconf reads a configuration file and checks it for errors. It prints parse errors to standard error and performs additional validation checks on the contents. This utility is used to:- Check config files for errors before using them in nsd(8)
- Query configuration values from shell scripts
- Extract specific configuration options for automation
Options
After reading, print the options to standard output in config file format. Without this option, only success or parse errors are reported.
Print full pathname when used with files, like with
-o pidfile. This includes the chroot in the way it is applied to the pidfile.Print usage help information and exit.
Return only this option from the config file. Can be used with
-z (zone) and -p (pattern), or without them to query the server section.Special values:zones- Print list of configured zonespatterns- Print list of configured patterns
-z is given without -o, nothing is printed.Print the key secret (base64 blob) configured for this TSIG key name. Used to help shell scripts parse the config file.
Print the authentication domain name configured for this tls-auth clause. Used to help shell scripts parse the config file.
Return the option specified with
-o for the given pattern name.Return the option specified with
-o for the given zone name.If this option is not given, the server section of the config file is used.Examples
Basic Validation
Check a config file for syntax errors:Query Server Options
Get the server port:Query Zone Information
Get the zonefile path for a zone:List Zones and Patterns
List all configured zones:Query Pattern Options
Get pattern configuration:Extract TSIG Key Information
Get the secret for a TSIG key:Extract TLS Auth Information
Get the authentication domain name:Display Full Configuration
Show the parsed configuration in normalized format:- Seeing how
include:directives are processed - Verifying pattern inheritance
- Debugging configuration issues
Use in Shell Scripts
The-o option makes nsd-checkconf particularly useful in shell scripts:
Exit Code
The nsd-checkconf program exits with:- 0: Success (no errors found)
- Non-zero: Configuration errors detected
Files
- Default config file:
/etc/nsd/nsd.conf(or compile-time default)
See Also
- nsd(8) - NSD name server daemon
- nsd.conf(5) - NSD configuration file format
- nsd-control(8) - NSD remote server control utility