Link to home
Start Free TrialLog in
Avatar of DanJourno
DanJournoFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Setting Up BIND

Hi,

I've got a Windows server running as a Primary DNS.

I want to set up a secondary DNS on Centos so that I can make DNS changes if the primary DNS goes down.

I've installed Bind and set up the config files following a guide but i'm getting the following when i start the NAMED service.

Error in named configuration:
zone localhost/IN: loading master file /var/named/localhost.zone: file not found
_default/localhost/IN: file not found

Im not sure what to do now. I've tried changing the directory to /var/named instead of /etc but that didnt help.

Thanks
Dan

From /var/named/localhost.zone

$TTL    86400
@               IN SOA  @       root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                IN NS           @
                IN A            127.0.0.1
                IN AAAA         ::1

Open in new window

From "/var/named/chroot/etc/named.conf"

options {
        directory "/etc";
        pid-file "/var/run/named/named.pid";
        recursion no;
        };

zone "company.com" {
        type slave;
        file "company.com.zone";
        masters {
                1.2.3.4;
        };
};

zone "localhost" {
        type master;
        file "/var/named/localhost.zone";
};

Open in new window

SOLUTION
Avatar of Kakhaber Siradze
Kakhaber Siradze
Flag of Georgia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of m_walker
m_walker

If you dont need the localhost zone file you can comment that section out.

If needed create the zone file.
It may need to be in the chroot folder (or not) so try one location then the other
I would try the choot one first, then copy to the other if it still errors.

/var/named/named.localhost
/var/named/chroot/var/named/named.localhost

Zone file data for the localhost
$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
        A       127.0.0.1
        AAAA    ::1

After you setup the zone file set the correct permissions
chmod 0640 named.localhost
chown root:namd named.localhost
then restart named/bind
Avatar of DanJourno

ASKER

ok, it runs successfully now.

however, it doesnt seem to be downloading the zone from the primary server. i've checked the primary server and its allowing zone transfers.

any ideas how i can diagnose this?

thanks
dan
Please show logfile, from this mashine, and if possible - from primary NS.
Ensure on your primary server that your backup is has an NS record.
If you dont want to make the slave/backup known, then you will need to set its ip address in the allowed to (zone)transfer list. (NS record hosts should be allowed by default.)
ie: in this part of the zone file settings

zone..png
Please show logfile, from this mashine, and if possible - from primary NS.

Where are the BIND logs kept in centos?

The Primary server doesnt show anything unusual in the logs.

Thanks
Dan
you will need to set its ip address in the allowed to (zone)transfer list. (NS record hosts should be allowed by default

I've got the option checked that says Allow Transfers to Any Server.

Thanks
Dan
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks.

it was a permissions issue.
Good to hear you got it working.