1

I want to restart the named service but I got error :

[root@KAASH-HIS-1 named]# service named restart

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

then I run the command systemctl status named.service to check the status of named service but its failed also :

[root@KAASH-HIS-1 named]# systemctl status named.service
● named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2023-02-17 02:11:18 +03; 13s ago
  Process: 10560 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (code=exited, status=1/FAILURE)

Feb 17 02:11:18 KAASH-HIS-1 systemd[1]: Starting Berkeley Internet Name Domain (DNS)...
Feb 17 02:11:18 KAASH-HIS-1 bash[10560]: /etc/named.conf:62: missing ';' before '}'
Feb 17 02:11:18 KAASH-HIS-1 systemd[1]: named.service: control process exited, code=exited status=1
Feb 17 02:11:18 KAASH-HIS-1 systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Feb 17 02:11:18 KAASH-HIS-1 systemd[1]: Unit named.service entered failed state.
Feb 17 02:11:18 KAASH-HIS-1 systemd[1]: named.service failed.
[root@KAASH-HIS-1 named]# 

this is /etc/named.conf file

[root@KAASH-HIS-1 named]# cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost 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.html

options {
    listen-on port 53 { 127.0.0.1;10.93.200.34; };
    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";
    recursing-file  "/var/named/data/named.recursing";
    secroots-file   "/var/named/data/named.secroots";
    allow-query     { localhost; };

    /* 
     - 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 yes;

    dnssec-enable yes;
    dnssec-validation yes;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.root.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";
};
zone "kaash.local" IN {
type master;
file "forward.kaash.local";
allow-update {none;};
};

zone "200.93.10.in-addr.arpa" IN { 
type master;
file "reverse.kaash.local";
allow-update {none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";


 

this is forward.kaash.local zone file :

[root@KAASH-HIS-1 named]# cat forward.kaash.local
  $TTL 1D 

    @       IN SOA kaash-his-1.kaash.local. root.kaash.local. (

                                            2014051001      ; serial

                                            3600            ; refresh

                                            1800            ; retry

                                            604800          ; expire

                                            86400           ; minimum 
)

    @               IN      NS     kaash-his-2.kaash.local.

    @               IN      PTR    kaash.local.
    kaash-his-1     IN      A      10.93.200.34
    KAASH-HIS-2     IN      A      10.93.200.37
    kaash-scan      IN      A      10.93.200.81
    kaash-scan      IN      A      10.93.200.82
    kaash-scan      IN      A      10.93.200.83

    34              IN      PTR    kaash-his-1.kaash.local
    39              IN      PTR    kaash-his-2.kaash.local
    81              IN      PTR    kaash-scan.kaash.local
    82              IN      PTR    kaash-scan.kaash.local
    83              IN      PTR    kaash-scan.kaash.local

this is reverse file zone :

[root@KAASH-HIS-1 named]# cat reverse.kaash.local
$TTL 1D 

    @       IN SOA kaash-his-1.kaash.local. root.kaash.local. (

                                            2014051001      ; serial

                                            3600            ; refresh

                                            1800            ; retry

                                            604800          ; expire

                                            86400           ; minimum 
)

    @               IN      NS     kaash-his-2.kaash.local.

    @               IN      PTR    kaash.local.
    kaash-his-1     IN      A      10.93.200.34
    KAASH-HIS-2     IN      A      10.93.200.37
    kaash-scan      IN      A      10.93.200.81
    kaash-scan      IN      A      10.93.200.82
    kaash-scan      IN      A      10.93.200.83

    34              IN      PTR    kaash-his-1.kaash.local
    39              IN      PTR    kaash-his-2.kaash.local
    81              IN      PTR    kaash-scan.kaash.local
    82              IN      PTR    kaash-scan.kaash.local
    83              IN      PTR    kaash-scan.kaash.local

How to solve this error Failed to start Berkeley Internet Name Domain (DNS) and restart named.service ?

UPDATE:

I added the ; and another error show now :

[root@KAASH-HIS-1 named]# systemctl status named.service
● named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2023-02-17 09:14:20 +03; 16s ago
  Process: 37422 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (code=exited, status=1/FAILURE)

Feb 17 09:14:20 KAASH-HIS-1 bash[37422]: _default/kaash.local/IN: no owner
Feb 17 09:14:20 KAASH-HIS-1 bash[37422]: zone localhost.localdomain/IN: loaded serial 0
Feb 17 09:14:20 KAASH-HIS-1 bash[37422]: zone localhost/IN: loaded serial 0
Feb 17 09:14:20 KAASH-HIS-1 bash[37422]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
Feb 17 09:14:20 KAASH-HIS-1 bash[37422]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Feb 17 09:14:20 KAASH-HIS-1 bash[37422]: zone 0.in-addr.arpa/IN: loaded serial 0
Feb 17 09:14:20 KAASH-HIS-1 systemd[1]: named.service: control process exited, code=exited status=1
Feb 17 09:14:20 KAASH-HIS-1 systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Feb 17 09:14:20 KAASH-HIS-1 systemd[1]: Unit named.service entered failed state.
Feb 17 09:14:20 KAASH-HIS-1 systemd[1]: named.service failed.

1 Answer 1

1

The systemctl status named.service shows the error:

/etc/named.conf:62: missing ';' before '}'

So in your /etc/named.conf you would have (ignore my comments //):

....
zone "." IN {
    type hint;
    file "named.ca";
};
zone "kaash.local" IN {
     type master;
     file "forward.kaash.local";
     allow-update {none;}; // here it was missing the `;`
}; // line 62
....
3
  • I added ';' and another error now show can you see UPDATE in question thank you :)
    – Ziad Adnan
    Feb 17, 2023 at 6:22
  • 1
    Your DNS records have white space at the left-most column. If a non-comment line in a zone file starts with white space, it is considered a continuation of the record in the previous line - but here your first record begins with <space><space>@ instead of just @, and there is no record before it, so it looks like a continuation with no matching beginning - hence the "no owner" error message.See this question on Server Fault.SE for a similar case.
    – telcoM
    Feb 17, 2023 at 7:01
  • yes when I removed white space its working and no errors when run the command systemctl status named.service thank you so much
    – Ziad Adnan
    Feb 17, 2023 at 7:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .