1

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
~
user274374
  • 29
  • 1
  • 1
  • 3

2 Answers2

6

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.

HBruijn
  • 72,524
  • 21
  • 127
  • 192
2

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).

tim
  • 1,197
  • 3
  • 10
  • 23
  • $TTL 86400 @ IN SOA benu123.com. root( 2010052601 ; serial 3600 ; refresh 1800 ; retry 604800 ; expire 86400 ; minimum ) IN NS localhost localhost IN A 127.0.0.1 localhost IN AAAA ::1 benu55 IN AAAA 2001::2222 benu89 IN AAAA 2002::2222 – user274374 Mar 04 '15 at 09:15
  • modified the zone file like this but still unable to start the bind service – user274374 Mar 04 '15 at 09:16
  • modified the zone file like this but still unable to start the bind service – user274374 Mar 04 '15 at 09:16
  • Don't try to paste files into comments; cut-and-paste them into your question via the "edit" link, it helps keep the formatting. And I don't think you've read what Tim wrote, either - *you need an A record for your NS host* (and pay attention to canonicalisation). – MadHatter Mar 04 '15 at 09:18