CentOS – Unable to Start BIND DNS Server on CWP

centos

I'm configing CentOS Web Panel on my server but there is a problem
all my services is working but "BIND DNS Server"

When i try to start it. It says :

Job for named.service failed because the control process exited with error code. See "systemctl status named.service" and "journalctl -xe" for details.

When i click on show Show journalctl output
it contains this :

- The start-up result is done.
Aug 12 14:13:22 2.179.254.91 systemd[1]: Starting Berkeley Internet Name Domain (DNS)...
-- Subject: Unit named.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit named.service has begun starting up.
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:11: unknown option 'listen-on'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:12: unknown option 'listen-on-v6'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:13: unknown option 'directory'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:14: unknown option 'dump-file'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:15: unknown option 'statistics-file'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:16: unknown option 'memstatistics-file'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:17: unknown option 'allow-query'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:27: unknown option 'recursion'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:27: unknown option 'dnssec-enable'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:28: unknown option 'dnssec-validation'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:29: unknown option 'bindkeys-file'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:29: unknown option 'managed-keys-directory'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:29: unknown option 'pid-file'
Aug 12 14:13:22 2.179.254.91 bash[23218]: /etc/named.conf:30: unknown option 'session-keyfile'
Aug 12 14:13:22 2.179.254.91 systemd[1]: named.service: control process exited, code=exited status=1
Aug 12 14:13:22 2.179.254.91 systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
-- Subject: Unit named.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit named.service has failed.
-- 
-- The result is failed.
Aug 12 14:13:22 2.179.254.91 systemd[1]: Unit named.service entered failed state.
Aug 12 14:13:22 2.179.254.91 systemd[1]: named.service failed.

named.conf file:

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a any DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.htmloptions {
    listen-on port 53 { any; };
    listen-on-v6 port 53 { ::1; };
    directory   "/var/named";
    dump-file   "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { any; };   /* 
     - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
     - If you are building a RECURSIVE (caching) DNS server, you need to enable 
       recursion. 
     - If your recursive DNS server has a public IP address, you MUST enable access 
       control to limit queries to your legitimate users. Failing to do so will
       cause your server to become part of large scale DNS amplification 
       attacks. Implementing BCP38 within your network would greatly
       reduce such attack surface 
    */
    recursion no;   dnssec-enable yes;
    dnssec-validation yes;  /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";  managed-keys-directory "/var/named/dynamic";    pid-file "/run/named/named.pid";
    session-keyfile "/run/named/session.key";
};logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};zone "." IN {
    type hint;
    file "named.ca";
};include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

zone "ftrade.ir" {
    type master;
    file "/var/named/ftrade.ir.db";};// zone_end ftrade.ir

//zone "nss1.infz.ir" {type master;file "/var/named/nss1.infz.ir.db";};//zone "" {type master;file "/var/named/.db";};
//zone "" {type master;file "/var/named/.db";};//zone "ns1.centos-webpanel.com" {type master;file "/var/named/ns1.centos-webpanel.com.db";};
//zone "ns2.centos-webpanel.com" {type master;file "/var/named/ns2.centos-webpanel.com.db";};

// zone infz.ir
zone "infz.ir" {
    type master;
    file "/var/named/infz.ir.db";};
// zone_end infz.ir

What i want to do is , I want to work with my domain "infz.ir" and my web panel use its dns with this ip : 2.179.254.91
My dns are :
ns1.infz.ir
ns2.infz.ir

Best Answer

Your named.conf is missing a crucial line from the beginning and that's the root cause for all the errors you get. You have the ending for your options { }; block, but it never starts! It should start like this:

options {
    listen-on port 53 { any; };
    // all the other options
};logging {