Checking the configuration of named.conf and zone files

The bind package has utilities to check the syntax of named.conf and any zone files. We can make use of those binaries to check our modifications done to those files before reloading or restarting named service.

To check the sytax of zone file /var/named/serverbuddies.com.db

[root@bash ~]# named-checkzone kb.com /var/named/serverbuddies.com.db
zone serverbuddies.com.db/IN: loaded serial 2006032401
OK

If everything is correct, it will show the serial number with which the zone file is loaded. Otherwise, it will give error message indicating the line number at which the error occured.

To check the syntax of named.conf file,

[root@bash ~]# named-checkconf /etc/named.conf

You may also load the configuration of all master zones listed in named.conf at the time of checking the syntax as,

[root@bash ~]# named-checkconf -z /etc/named.conf

The command will show a detailed output in case any error in named.conf file.

This way we can make sure that we are not editing the configuration file wrongly.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.