Getting error while setting up DNS

Issues related to configuring your network
Post Reply
goodfellowtodd
Posts: 9
Joined: 2015/06/07 18:29:14

Getting error while setting up DNS

Post by goodfellowtodd » 2015/06/07 18:44:53

I am trying to configure dns server in CentOS VM that is deployed on Oracle Virtual Box. I have placed all the zone files in /var/named/chroot/var/named/ location and named file in /etc/named.conf. While trying to restart named service I am getting this error: Attaching all config files for your reference. Any help is highly appreciated.

service named restart
Stopping named: [ OK ]
Starting named:
Error in named configuration:
127.0.0.zone:7: ignoring out-of-zone data (1.0.0.127.IN-ADDR.ARPA)
zone localhost/IN: NS 'localhost' has no address records (A or AAAA)
zone localhost/IN: not loaded due to errors.
_default/localhost/IN: bad zone
zone 0.0.127.in-addr.arpa/IN: loaded serial 4
zone puppetmaster.itmasters.local/IN: loaded serial 2015060700
zone 1.168.192.IN-ADDR.ARPA/IN: loaded serial 2015060700
[FAILED]


Also included : 127.0.0.zone in/var/named/chroot/var/named/

Code: Select all

$TTL 86400
@ IN  SOA localhost. root.localhost. ( 4 10800 3600 604800 86400 )

  IN  NS  localhost.

localhost			A     127.0.0.1
1.0.0.127.IN-ADDR.ARPA.    IN  PTR    localhost.
************ puppetmaster.itmasters.local.zone************

Code: Select all

cat puppetmaster.itmasters.local.zone
; Replace all X(s) with your station number
; Be careful not to replace the X in the MX RR :)

$TTL 86400
@ IN  SOA puppetmaster.itmasters.local. root.puppetmaster.itmasters.local. (
; Dont forget to increment the serial number
                2015060700      ;serial number
                1H              ;refresh slave
                5M              ;retry refresh
                1W              ;expire zone
                5M              ;cache time-to-live for negative answers
)

; Name server resource records ( NS )
; owner                 TTL     CL  type        RDATA
@                               IN  NS          puppetmaster.itmasters.local.


; Mail exchanger resource records ( MX )
; owner                 TTL     CL  type RDATA
puppetmaster.itmasters.local.           IN  MX   10 puppetmaster.itmasters.local.

; Internet address resource records( A )
; owner                 TTL     CL  type        RDATA
@                               IN  A           192.168.1.175
puppetmaster                    IN  A           192.168.1.175
************ 192.168.1.175.zone************

Code: Select all

cat 192.168.1.175.zone
; Replace all X(s) with your station number
$TTL 86400
@ IN SOA puppetmaster.itmasters.local. root.puppetmaster.itmasters.local. (
; Don't forget to increment the serial number
                2015060700      ;serial number
                1H              ;refresh slave
                5M              ;retry refresh
                1W              ;expire zone
                5M              ;cache time-to-live for negative answers
)

; owner                 TTL     CL  type        RDATA
@                               IN  NS          puppetmaster.itmasters.local.
175.1.168.192.IN-ADDR.ARPA.     IN  PTR         puppetmaster.itmasters.local.
************ 192.168.1.175.zone************


************/etc/named.conf************

Code: Select all

cat /etc/named.conf
# /etc/named.conf
#
# Template file for BIND labs.
# Remember to replace each X with your station number!
# Please note three different comment styles are used for
# illustrative purposes only

options {
        directory "/var/named";
        // We're forwarding DNS requests to server1.example.com
        // and letting it talk to the root name servers; if it
        // fails to respond, we *don't* want to talk to the root
        // name servers directly.
        forwarders { 192.168.1.175; };
        forward only;
        auth-nxdomain no;
};
// Magic to make rndc work
include "/etc/rndc.key";
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndc-key; };
};


zone "." {
        type hint;
        file "named.ca";
};

zone "localhost" {
        type master;
        file "127.0.0.zone";
};

zone "0.0.127.in-addr.arpa" {
        type master;
        file "127.0.0.zone";
};

/* REPLACE X HERE WITH YOUR STATION NUMBER
 * MAKE SURE YOU RENAME THE FILE WHEN YOU ARE DONE */
zone "puppetmaster.itmasters.local" {
        type master;
        file "puppetmaster.itmasters.local.zone";
};

/* REPLACE X HERE WITH YOUR STATION NUMBER
 * MAKE SURE YOU RENAME THE FILE WHEN YOU ARE DONE */
zone "1.168.192.IN-ADDR.ARPA" {
        type master;
        file "192.168.1.175.zone";
};


// Here's a commented-out example of what a slave zone for
// example.com could look like.  It's possible for the same
// server to be master for some zones and slave for others
// at the same time.

# zone "itmasters.local" {
#       type slave;
#       masters { 192.168.1.175; };
#       file "itmasters.local.zone";
# };
#
# zone "1.168.192.in-addr.arpa" {
#       type slave;
#       masters { 192.168.1.175; };
#       file "192.168.1.zone";
# };
************/etc/named.conf************
Last edited by goodfellowtodd on 2015/06/07 20:06:40, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Getting error while setting up DNS

Post by TrevorH » 2015/06/07 18:52:38

Please wrap your files in tags next time and not as attachments. I have not read them because they want to be downloaded and opened in an editor. However your error is
zone localhost/IN: NS 'localhost' has no address records (A or AAAA)
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

goodfellowtodd
Posts: 9
Joined: 2015/06/07 18:29:14

Re: Getting error while setting up DNS

Post by goodfellowtodd » 2015/06/07 19:03:44

Sure..sorry about that...where and what should I update to get rid of this error?

igsmigs88
Posts: 29
Joined: 2014/07/23 20:46:29

Re: Getting error while setting up DNS

Post by igsmigs88 » 2015/06/07 19:44:10

hi,

edit zone
localhost IN A 127.0.0.1

also put here /etc/named.conf , and zones config for more info

goodfellowtodd
Posts: 9
Joined: 2015/06/07 18:29:14

Re: Getting error while setting up DNS

Post by goodfellowtodd » 2015/06/07 20:07:03

Hi igsmigs88 : updated post..could you please help me with this?

goodfellowtodd
Posts: 9
Joined: 2015/06/07 18:29:14

Re: Getting error while setting up DNS

Post by goodfellowtodd » 2015/06/08 05:17:56

Let me know if any one needs any more information..I have been doing lots of trial and error settings but couldn't get through..help is highly appreciated.

igsmigs88
Posts: 29
Joined: 2014/07/23 20:46:29

Re: Getting error while setting up DNS

Post by igsmigs88 » 2015/06/08 07:45:39

hi,

make new file for reverse zone(127.0.0.rev.zone)
try this

for reverse zone edit

[code; Replace all X(s) with your station number
$TTL 86400
@ IN SOA puppetmaster.itmasters.local. root.puppetmaster.itmasters.local. (
; Don't forget to increment the serial number
2015060700 ;serial number
1H ;refresh slave
5M ;retry refresh
1W ;expire zone
5M ;cache time-to-live for negative answers
)

; owner TTL CL type RDATA
@ IN NS puppetmaster.itmasters.local.
@ IN PTR itmasters.local.

@ IN A 192.168.1.175
175 IN PTR puppetmaster.itmasters.local.][/code]
###################################

hit for conf error check:

#named-checkconf /etc/named.conf

#named-checkzone puppetmaster.itmasters.local /var/named/chroot/var/named/puppetmaster.itmasters.local.zone
#named-checkzone puppetmaster.itmasters.local /var/named/chroot/var/named/192.168.1.175.zone

#service named restart
Last edited by igsmigs88 on 2015/06/08 12:19:02, edited 7 times in total.

User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Getting error while setting up DNS

Post by TrevorH » 2015/06/08 07:47:30

Your named.conf has two zones pointing to the same file
zone "localhost" {
type master;
file "127.0.0.zone";
};

zone "0.0.127.in-addr.arpa" {
type master;
file "127.0.0.zone";
};
One of those should be the zone for forward lookups of localhost addresses and the other for reverse lookups. They should not be the same file.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

goodfellowtodd
Posts: 9
Joined: 2015/06/07 18:29:14

Re: Getting error while setting up DNS

Post by goodfellowtodd » 2015/06/10 20:24:09

This issue is fixed. Please close this post. Thank you so much :)

Post Reply