2

I am getting Error while Restarting the Named.service in Red-hat 7 Here is my Lab Status and all the Command.

Configure DNS in REDHAT 7 DNS Name p1.linux.com IP address 192.168.1.1/24 N/W ID 192.168.1.0/24

[root@p1 Desktop]# hostname
p1.linux.com

# yum -y install bind bind-utils

it was successful

Configuring BIND: I have Edited the Following Lines

[root@p1 Desktop]# vim /etc/named.conf
options {
        #listen-on port 53 { 127.0.0.1; };
        #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     { localhost;192.168.1.0/24; };
        allow-transfer  { 192.168.1.1; };

zone "linux.com" IN {   
    type master;
    file "fwd.linux.com.db";
    allow-update { none; };
};  

zone "1.168.192.in-addr.arpa" IN {  
    type master;
    file "1.168.192.db";
    allow-update { none; };
};  

Create a zone file called fwd.linux.com.db for forward zone under /var/named directory

# vi /var/named/fwd.linux.com.db

$TTL 86400
@   IN  SOA     p1.linux.com. root.linux.com. (
2014112511  ;Serial
3600        ;Refresh
1800        ;Retry
604800      ;Expire
86400       ;Minimum TTL
)
;Name Server Information
@      IN  NS      p1.linux.com.
;IP address of Name Server
primary IN  A       192.168.1.1
;Mail exchanger
p1.linux.com. IN  MX 10   mail.linux.com.
;A - Record HostName To Ip Address
www     IN  A       192.168.1.100
mail    IN  A       192.168.1.150
;CNAME record
ftp     IN CNAME        www.p1.linux.com.

Create a zone file called 1.168.192.db for reverse zone

# vi /var/named/1.168.192.db

$TTL 86400
@   IN  SOA     p1.linux.com. root.linux.com. (
2014112511  ;Serial
3600        ;Refresh
1800        ;Retry
604800      ;Expire
86400       ;Minimum TTL
)
;Name Server Information
@ IN  NS      p1.linux.com.
;Reverse lookup for Name Server
1        IN  PTR     p1.linux.com.
;PTR Record IP address to HostName
100      IN  PTR     www.linux.com.
150      IN  PTR     mail.linux.com.

Now Problem Occur

[root@p1 Desktop]# systemctl restart named.service
Job for named.service failed. See 'systemctl status named.service' and 'journalctl -xn' for details.
[root@p1 Desktop]# 

Here is error

[root@p1 Desktop]# systemctl status named.service
named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; enabled)
   Active: failed (Result: exit-code) since Wed 2015-03-11 13:25:43 IST; 1min 0s ago
  Process: 5283 ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf (code=exited, status=1/FAILURE)

Mar 11 13:25:43 p1.linux.com named-checkconf[5283]: _default/linux.com/IN: bad zone
Mar 11 13:25:43 p1.linux.com named-checkconf[5283]: zone 1.168.192.in-addr.arpa/IN: loaded serial 2014112511
Mar 11 13:25:43 p1.linux.com named-checkconf[5283]: zone localhost.localdomain/IN: loaded serial 0
Mar 11 13:25:43 p1.linux.com named-checkconf[5283]: zone localhost/IN: loaded serial 0
Mar 11 13:25:43 p1.linux.com named-checkconf[5283]: 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: ...erial 0
Mar 11 13:25:43 p1.linux.com named-checkconf[5283]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Mar 11 13:25:43 p1.linux.com named-checkconf[5283]: zone 0.in-addr.arpa/IN: loaded serial 0
Mar 11 13:25:43 p1.linux.com systemd[1]: named.service: control process exited, code=exited status=1
Mar 11 13:25:43 p1.linux.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Mar 11 13:25:43 p1.linux.com systemd[1]: Unit named.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
[root@p1 Desktop]# 

What is the Problem and How should i solve it can any one check it Thank you enter image description here

2

You have an NS record in the linux.com zone with the value p1.linux.com, but no A record for p1.linux.com.

You have an A record for primary.linux.com with the comment IP address of Name Server but that's wrong, and such comments can blind you to the real problem.

0

You forgot to close up your options stanza.

options {
    #listen-on port 53 { 127.0.0.1; };
    #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     { localhost;192.168.1.0/24; };
    allow-transfer  { 192.168.1.1; };
};  ## This right here. You're missing this.

As a side note... this wouldn't stop bind from starting up, but you need an A record for p1.linux.com. Otherwise an nslookup will not find it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.