After creating DNS zone files and configuring them, it’s important to check if the syntax in the zone files is correct. Incorrect syntax may cause the files not to work at all.
1. To check the configuration files run the following command:
named-checkconf
To check a DNS zone files we can use named-checkzone command:
named-checkzone example.com /var/named/example.com.db zone example.com/IN: loaded serial 1 OK
For the reverse zone file check
named-checkzone 0.10.10.in-addr.arpa /var/named/10.10.10.10.db zone 0.168.192.in-addr.arpa/IN: loaded serial 2 OK
2. Restart bind
service named restart
3. You can test the bind server configuration using dig command
dig @10.10.10.10 www.example.com ; <<>> DiG 9.6-ESV-R1 <<>> @10.10.10.10 www.example.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<