Howto check Bind9 zone files and main configuration?

  • Hello,


    when i try to check a zone.



    I see this in one ubuntu 14.04 install and a 16.04 install.


    And i-mscp version from 1.3.14 till 1.4.4


    Any ideas ?


    thx and best wishes


    Niels

  • @sfsolutions


    You should really consider to read the NAMED-CHECKZONE(8) man page. Your command is wrong.


    With i-MSCP 1.4.x branch for which zone files are now dumped in raw format and for which zone location has changed: https://github.com/i-MSCP/imsc…rrata.md#dns-server-bind9


    Shell-Script
    1. root@devuan:~# named-checkzone -f raw bbox.nuxwin.com /var/cache/bind/imscp/master/bbox.nuxwin.com.dbzone bbox.nuxwin.com/IN: 'bbox.nuxwin.com' found SPF/TXT record but no SPF/SPF record found, add matching type SPF recordzone bbox.nuxwin.com/IN: 'devuan.bbox.nuxwin.com' found SPF/TXT record but no SPF/SPF record found, add matching type SPF recordzone bbox.nuxwin.com/IN: 'panel.bbox.nuxwin.com' found SPF/TXT record but no SPF/SPF record found, add matching type SPF recordzone bbox.nuxwin.com/IN: loaded serial 2017052909OKroot@devuan:~#

    Note: Here, the warnings about SPF are expected. SPF records are deprecated but older versions of Bind9 are not aware of that fact ;)


    With current stable or older i-MSCP versions the command is identical but without the -f raw option and the root directory for zone files is simply /var/cache/bind ;)


    Now, for all i-MSCP versions you can also simply do:

    Shell-Script
    1. root@devuan:~# named-checkzone bbox.nuxwin.com /etc/imscp/bind/working/bbox.nuxwin.com.dbzone bbox.nuxwin.com/IN: 'bbox.nuxwin.com' found SPF/TXT record but no SPF/SPF record found, add matching type SPF recordzone bbox.nuxwin.com/IN: 'devuan.bbox.nuxwin.com' found SPF/TXT record but no SPF/SPF record found, add matching type SPF recordzone bbox.nuxwin.com/IN: 'panel.bbox.nuxwin.com' found SPF/TXT record but no SPF/SPF record found, add matching type SPF recordzone bbox.nuxwin.com/IN: loaded serial 2017052909OKroot@devuan:~#

    In which case, there is no need to specify the zone file format ;)


    For viewing all records from a specific zone, you can also do:

    Shell-Script
    1. root@devuan:~# dig axfr bbox.nuxwin.com; <<>> DiG 9.9.5-9+deb8u11-Debian <<>> axfr bbox.nuxwin.com;; global options: +cmdbbox.nuxwin.com. 10800 IN SOA ns1.bbox.nuxwin.com. hostmaster.bbox.nuxwin.com. 2017052909 10800 3600 1209600 3600bbox.nuxwin.com. 10800 IN A <ip>bbox.nuxwin.com. 10800 IN NS ns1.bbox.nuxwin.com.bbox.nuxwin.com. 10800 IN TXT "v=spf1 a mx -all"bbox.nuxwin.com. 10800 IN MX 10 mail.bbox.nuxwin.com.devuan.bbox.nuxwin.com. 10800 IN TXT "v=spf1 include:bbox.nuxwin.com -all"devuan.bbox.nuxwin.com. 10800 IN MX 10 mail.devuan.bbox.nuxwin.com.devuan.bbox.nuxwin.com. 60 IN A <ip>ftp.devuan.bbox.nuxwin.com. 10800 IN A <ip>imap.devuan.bbox.nuxwin.com. 10800 IN A <ip>mail.devuan.bbox.nuxwin.com. 10800 IN A <ip>pop.devuan.bbox.nuxwin.com. 10800 IN A <ip>pop3.devuan.bbox.nuxwin.com. 10800 IN A <ip>relay.devuan.bbox.nuxwin.com. 10800 IN A <ip>smtp.devuan.bbox.nuxwin.com. 10800 IN A <ip>www.devuan.bbox.nuxwin.com. 10800 IN CNAME devuan.bbox.nuxwin.com.ftp.bbox.nuxwin.com. 10800 IN A <ip>imap.bbox.nuxwin.com. 10800 IN A <ip>mail.bbox.nuxwin.com. 10800 IN A <ip>ns1.bbox.nuxwin.com. 10800 IN A <ip>panel.bbox.nuxwin.com. 10800 IN TXT "v=spf1 include:bbox.nuxwin.com -all"panel.bbox.nuxwin.com. 10800 IN MX 10 mail.panel.bbox.nuxwin.com.panel.bbox.nuxwin.com. 10800 IN A <ip>ftp.panel.bbox.nuxwin.com. 10800 IN A <ip>imap.panel.bbox.nuxwin.com. 10800 IN A <ip>mail.panel.bbox.nuxwin.com. 10800 IN A <ip>pop.panel.bbox.nuxwin.com. 10800 IN A <ip>pop3.panel.bbox.nuxwin.com. 10800 IN A <ip>relay.panel.bbox.nuxwin.com. 10800 IN A <ip>smtp.panel.bbox.nuxwin.com. 10800 IN A <ip>www.panel.bbox.nuxwin.com. 10800 IN CNAME panel.bbox.nuxwin.com.pop.bbox.nuxwin.com. 10800 IN A <ip>pop3.bbox.nuxwin.com. 10800 IN A <ip>relay.bbox.nuxwin.com. 10800 IN A <ip>smtp.bbox.nuxwin.com. 10800 IN A <ip>www.bbox.nuxwin.com. 10800 IN CNAME bbox.nuxwin.com.bbox.nuxwin.com. 10800 IN SOA ns1.bbox.nuxwin.com. hostmaster.bbox.nuxwin.com. 2017052909 10800 3600 1209600 3600;; Query time: 0 msec;; SERVER: 127.0.0.1#53(127.0.0.1);; WHEN: Mon May 29 20:59:53 CEST 2017;; XFR size: 37 records (messages 1, bytes 876)root@devuan:~#

    Now, if you want check your /etc/bind/named.conf:

    See the NAMED-CHECKCONF(8) man page.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206