Command named-checkconf checks the syntax only of a DNS (bind) configuration file. The file is parsed and checked for syntax errors, along with all files included by it. If there is no file specified with the command, /etc/named.conf is read by default.

1. Check bind9 (DNS) Configuration

In case of any changes done in the bind configuration, I recommend checking the DNS configuration file before restarting the service.

named-checkconf /etc/named.conf 

If the bind is running in chroot environment use the below command also along with the above command

named-checkconf -t /var/named/chroot /etc/named.conf 

The above command will show nothing if there is no error found in the configuration file. In case of any error will be displayed as output.

2. Check Bind Zone File

To check the syntax of the zone file using the command below. It will show the result in both cases.

named-checkzone /var/named/ 

Sample output;

zone loaded serial 3013040200

3. Check Configuration file in Older version of Bind

If you are using an older version of the bind, you can have also checked the configuration using the below command.

service named configtest 

Sample Outut:

zone loaded serial 42
zone localhost/IN: loaded serial 42
zone loaded serial 1997022700
zone loaded serial 1997022700
zone loaded serial 42
zone loaded serial 42