Solved

Setting Up BIND

Posted on 2011-03-23
12
488 Views
Last Modified: 2012-05-11
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

0
Comment
Question by:DanJourno
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 5

Assisted Solution

by:Angelgeo
Angelgeo earned 75 total points
ID: 35197560
zone localhost/IN: loading master file /var/named/localhost.zone: file not found

file must be there
/var/named/chroot/var/named/localhost.zone
0
 
LVL 8

Assisted Solution

by:pilson66
pilson66 earned 75 total points
ID: 35197561
If you run bind in chroot environment in /var/named/chroot, you need to save files to /var/named/chroot/var/named/
0
 
LVL 4

Expert Comment

by:m_walker
ID: 35197578
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
0
 
LVL 5

Author Comment

by:DanJourno
ID: 35197581
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
0
 
LVL 8

Expert Comment

by:pilson66
ID: 35197599
Please show logfile, from this mashine, and if possible - from primary NS.
0
 
LVL 4

Expert Comment

by:m_walker
ID: 35197600
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.)
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 4

Expert Comment

by:m_walker
ID: 35197632
ie: in this part of the zone file settings

zone..png
0
 
LVL 5

Author Comment

by:DanJourno
ID: 35197650
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
0
 
LVL 5

Author Comment

by:DanJourno
ID: 35197656
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
0
 
LVL 4

Accepted Solution

by:
m_walker earned 350 total points
ID: 35197736
BIND logs should be were your named.conf file told them to be
eg:
In my home test bind setup

logging {
        channel default_debug {
                file "data/named.run";
//              severity dynamic;
                severity info;
                print-category yes;
                print-severity yes;
                print-time yes;
        };
        category default
        {
                default_debug;
        };
};

Since I used a relative path in the logging section it will be under the base/root folder from the options section
eg:
directory       "/var/named";

for the zone transfer logs try the normal messages log file and post the response.

You may need to check the permissions on the target folder in linux.

From the config file above it looks like you are using the /etc folder for your zone files.  You might want to change that to a folder just for bind.  the bind process will need write access to the folder where the slave zone file is created.

You could try this (is simple)
create a bind zone folder
mkdir /bindzones
chown root:named /bindzones
chmod 0770 /bindzones
(0660 should be enough)
then in named.conf put the full path in the file for the backup zone to
file "/bindzones/company.com.zone";


restart and check
0
 
LVL 5

Author Closing Comment

by:DanJourno
ID: 35197758
thanks.

it was a permissions issue.
0
 
LVL 4

Expert Comment

by:m_walker
ID: 35197770
Good to hear you got it working.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MX Backup 4 57
Anything Suspicious in this Report Email on Linux Server 4 35
How to install Ubuntu 16 in DELL venue 8 pro 20 36
Linux VM 6 18
I will assume you are running a non-server version of some sort of Windows throughout this article. There are many flavors of Windows since Windows Server 2000 - 2008, XP Home & Pro, Vista Home & Pro, and Windows 7 Starter, Home, Pro, Ultimate, etc.…
Occasionally you run into the website or two that will not resolve properly using your own DNS servers.  Some people simply set up global forwarders for their DNS server.  I don’t recommend doing this because it can cause problems resolving addresse…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now