Check the default named configuration file with the command named-checkconf
. If the file contains no errors you get no output. We can add an extra bit to the command just to verify it is working correctly:
[callisto] (~) >>> named-checkconf /etc/named.conf && echo $?
0
In this case the return of the value 0 means that their were no errors. Lets create an error and see what we get:
callisto] (~) >>> cp /etc/named.conf ~/testnamed.conf
[callisto] (~) >>> echo "things" >> ~/testnamed.conf
[callisto] (~) >>> named-checkconf ~/testnamed.conf
/root/testnamed.conf:222: unknown option 'things'
/root/testnamed.conf:223: unexpected token near end of file
To check a specific zone you can use the named-checkzone
command.
named-checkzone domain.com /var/named/zone.domain.com
If you would like to check all DNS zones on the server you can use the -z flag
named-checkconf -z