Checking bind config & restarting service

I was using bind installed as DNS server in home lab and as I was doing multiple modification, I wanted to if I made any mistake in my configuration, so I made below little script which is supper easy to read and modify; it’ll just show where (which file) issue exist instead of checking manually each time or checking in log files for error.

One can simple modify template scope I’ve placed here or add new scopes.
Change DOMAIN, with your domain and then fw.domain.db with the file responsible for forward lookup zone; same for rev-IP which is reverse of network IP and rev.domain.db which is the one responsible for reverse lookup zone.
Last line is the bind file itself which will restart the service.

# ver 0.1

if (named-checkconf)
    echo "Config is good."
    echo "There's an issue with config."

named-checkzone DOMAIN /etc/bind/zones/master/fw.domain.db

named-checkzone /etc/bind/master/rev.domain.db

/etc/init.d/bind9 restart

For more information about forward and reverse zone you can check below links:

It's your kindness to leave a reply/feedback