unable to start the bind dns service in linux

Posted on

unable to start the bind dns service in linux – A server stack is the collection of software that forms the operational infrastructure on a given machine. In a computing context, a stack is an ordered pile. A server stack is one type of solution stack — an ordered selection of software that makes it possible to complete a particular task. Like in this post about unable to start the bind dns service in linux was one problem in server stack that need for a solution. Below are some tips in manage your linux server when you find problem about linux, bind, dns-server, , .

observed following errors when try to start the dns service in virtual linux pc

[root@mininat ~]# service named status
Redirecting to /bin/systemctl status  named.service
named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; disabled)
   Active: failed (Result: exit-code) since Wed 2015-03-04 03:36:40 EST; 1min 58s ago
  Process: 6135 ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf (code=exited, status=1/FAILURE)
  Process: 6133 ExecStartPre=/usr/libexec/generate-rndc-key.sh (code=exited, status=0/SUCCESS)

Mar 04 03:36:40 mininat.benunets.com named-checkconf[6135]: _default/benu123.com/IN: unexpected end of input
Mar 04 03:36:40 mininat.benunets.com named-checkconf[6135]: zone localhost.localdomain/IN: loaded serial 2010052601
Mar 04 03:36:40 mininat.benunets.com named-checkconf[6135]: zone localhost/IN: loaded serial 2010052601
Mar 04 03:36:40 mininat.benunets.com named-checkconf[6135]: 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
Mar 04 03:36:40 mininat.benunets.com named-checkconf[6135]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Mar 04 03:36:40 mininat.benunets.com named-checkconf[6135]: zone 0.in-addr.arpa/IN: loaded serial 0
Mar 04 03:36:40 mininat.benunets.com systemd[1]: named.service: control process exited, code=exited status=1
Mar 04 03:36:40 mininat.benunets.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Mar 04 03:36:40 mininat.benunets.com systemd[1]: Unit named.service entered failed state.
Mar 04 03:38:36 mininat.benunets.com systemd[1]: Stopped Berkeley Internet Name Domain (DNS).
[root@mininat ~]# service named start
Redirecting to /bin/systemctl start  named.service
Job for named.service failed. See 'systemctl status named.service' and 'journalctl -xn' for details.
[root@mininat ~]# service named status
Redirecting to /bin/systemctl status  named.service
named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; disabled)
   Active: failed (Result: exit-code) since Wed 2015-03-04 03:38:44 EST; 2s ago
  Process: 6309 ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf (code=exited, status=1/FAILURE)
  Process: 6306 ExecStartPre=/usr/libexec/generate-rndc-key.sh (code=exited, status=0/SUCCESS)

Mar 04 03:38:44 mininat.benunets.com named-checkconf[6309]: zone benu123.com/IN: not loaded due to errors.
Mar 04 03:38:44 mininat.benunets.com named-checkconf[6309]: _default/benu123.com/IN: unexpected end of input
Mar 04 03:38:44 mininat.benunets.com named-checkconf[6309]: zone localhost.localdomain/IN: loaded serial 2010052601
Mar 04 03:38:44 mininat.benunets.com named-checkconf[6309]: zone localhost/IN: loaded serial 2010052601
Mar 04 03:38:44 mininat.benunets.com named-checkconf[6309]: 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
Mar 04 03:38:44 mininat.benunets.com named-checkconf[6309]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Mar 04 03:38:44 mininat.benunets.com named-checkconf[6309]: zone 0.in-addr.arpa/IN: loaded serial 0
Mar 04 03:38:44 mininat.benunets.com systemd[1]: named.service: control process exited, code=exited status=1
Mar 04 03:38:44 mininat.benunets.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Mar 04 03:38:44 mininat.benunets.com systemd[1]: Unit named.service entered failed state.

please find my zone file below

[root@mininat ~]# vi /var/named/benu123.com
$TTL 86400
@       IN SOA  benu123.com. root(
                                        2010052601      ; serial
                                        3600    ; refresh
                                        1800    ; retry
                                        604800  ; expire
                                        86400   ; minimum
)
                IN NS     benu123.com
localhost       IN A      127.0.0.1
localhost       IN AAAA   ::1
benu55          IN AAAA   2001::2222
benu89          IN AAAA   2002::2222
~

Well as you noticed the reason Bind won’t start is because of the error condition returned by the pre-start check: /usr/sbin/named-checkconf -z /etc/named.conf. You’ll need to fix that.

The lonely tilde character ~ at the end of your zone file is not a valid resource record and should be removed.

You’re declaring an in-zone name-server:

                IN NS     benu123.com

without creating an A record for your name-server. That is plain wrong. Additionally a resource record that does not end with a . is treated as DNS short-hand and gets the $ORIGIN (the zone name) appended, so what you have now is functionally equivalent to:

                IN NS     benu123.com.benu123.com.

You should probably should want something like this instead:

$ORIGIN benu123.com.
$TTL 86400
@       IN SOA  benu123.com. root.benu123.com(
                                        2014030401      ; serial
                                        3600    ; refresh
                                        1800    ; retry
                                        604800  ; expire
                                        86400   ; minimum
)
                IN NS     benu123.com.
@               IN A      192.168.1.1   ; replace this with the ip-address of your name-server
localhost       IN A      127.0.0.1
localhost       IN AAAA   ::1
benu55          IN AAAA   2001::2222
benu89          IN AAAA   2002::2222

where I used @ as another DNS shorthand trick, it is equivalent to the $ORIGIN or the domain name benu123.com.

At least the NS entry needs an A or AAAA record (and most likely a dot at the end unless your nameserver is to be called benu123.com.benu123.com).

Leave a Reply

Your email address will not be published. Required fields are marked *