Solved

Bind zone files not found Error!!!

Posted on 2009-04-03
60
2,666 Views
Last Modified: 2012-05-06
Hi
pls help me in making primary dns server.My server is RHEL5.I have installed three packages bind, bind-chroot, and chahing-nameserver  but when i restart named daemon it says ;-

[root@rhce ~]# service named restart
Stopping named:                                            [FAILED]
Starting named:
Error in named configuration:
zone ram.com/IN: loading master file ram.zone: file not found
_default/ram.com/IN: file not found
zone 1.168.192.in-addr.arpa/IN: loading master file rev.zone: file not found
_default/1.168.192.in-addr.arpa/IN: file not found

my named.conf  and zones are attached
in /etc/sysconfig/named its
 
ROOTDIR=/var/named/chroot
i have created zones in /var/named/chroot/var/named is that wrong?

pls guide me in this process iam an linux beginner.


Thanks
Ashu
 
named.txt
ram.txt
rev.txt
0
Comment
Question by:vmware420
  • 27
  • 21
  • 11
60 Comments
 
LVL 76

Expert Comment

by:arnold
Comment Utility
You have options and directory commented out in named.conf.

Which version of named do you have?
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
I added that line by myself after getting this error but after adding that it give me another saying " /var/named/chroot/..." not found

bind version is bind-9.3.3-7.el5
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Can you please attached your fill named.conf file ???
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
its attached as named.txt above becoz EE" format doesnt alow .conf file
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
but that one is not your full named.conf file,
copy and past the full named.conf file

also as arnold said,  dnot comment out Options directory

is your named.conf file , in /etc directory

or /var/named/chroot/etc directory ??


0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
its in var/named/chroot/etc  and this is custom named.conf file thats all i have
I added that commented  line by myself after getting above  error but after adding that it give me another saying " /var/named/chroot/..." not found
so i commented it out
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
What are the contents of the /var/named/chroot/etc/named.conf?
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
@arnold

Its attached already above as named.txt
0
 
LVL 76

Accepted Solution

by:
arnold earned 63 total points
Comment Utility
If you have the bind chrooted, the zone configuration should be in the /var/named/chroot/etc/named.conf and not in the /etc/named.conf.

/etc/named.conf has no directory defined such that named when starting prior to chrooting, is not able to locate the files in /etc/ which is the initial operating directory.

the /etc/named.conf might be just a place holder to get bind started.  The configuration is read in after the chroot jail is set.
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
You are missing the section that defines options, directory, etc.
You should have a sample named.conf file http://www.zytrax.com/books/dns/ch7/.

Your named.conf is effectively a list of names and locations without specifying the country nor the city.

You should have something like the example below:
http://www.wellho.net/resources/ex.php4?item=a193/named.conf

Not just zone definitions.

0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
i will say at fist follow what arnold saying, there is no points of following to guy.

but i will just add some comments..

you have done something wrong

1. how did  you install your bind ?? yum bind bind-chroot caching-nameserve ??

2.your named.conf looks horrible to me.. did you delete all the lines from named.conf ?? or you got this one by default ??

3. if you look at my chrooted bind named.conf it will say something liek this

options {
        listen-on port 53 { xxx; xxx; 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";

        // Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

        allow-query     { ANY; };
        Recursion no;
};


if nothing work at last , my advise would be

 uninstall the bind and install from beginning ??
then it would be easy to work with ..
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
@arnold
pls re-read the question becoz  what ur saying is already done accordingly and its not essentianl to have such an long file becoz i need an basic primary dns server i checked both .conf and zones file they are correct via named-checkconf and named-chaeckzone command its only the problem of PATH here which already set by bind-chroot package in /etc/sysconfig/named .....but still doesnt work its an fresh install O.S ...but its not working......if you guys have any sample config in your environment pls share with me if possible

@Fosiul

the contents you pasted above are part of my cahing-nameserver file see:-

options {
        listen-on port 53 { 127.0.0.1; 192.168.1.250; };
        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";
        query-source    port 53;
        query-source-v6 port 53;
        allow-query     { localhost; any; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
        match-clients      { localhost; any; };
        match-destinations { localhost; any; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
};

and if i changes the dir "/var/named" to /var/named/chroot it still says FILE NOT FOUND.....and i just reinstalled all rpms the prob still persists
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Ok thats it , i guess you are editing wrong file ...


tell me do you have these 2 files  in /var/named/chroot/named/etc/


named.caching-nameserver.conf
named.rfc1912.zones


 ???
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
They are  three files
named.caching-nameserver.conf
named.rfc1912.zones
named.conf

packages installed

[root@rhce files]# rpm -qa | grep bind
bind-libs-9.3.3-7.el5
bind-9.3.3-7.el5
ypbind-1.19-7.el5
bind-utils-9.3.3-7.el5
bind-chroot-9.3.3-7.el5

Now pls tell me what to do
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
ok now

this named.conf , did you create this file ?? if yes, Delete that one .

Normaly bindchroot and chaching nameserver we take named.caching-nameserver.conf as named.conf

and named.rfc1912.zones will hold all the zone file information

put all your zone file info named.rfc1912.zones

and put those zone file in /var/named/chroot/var/named




0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
@Fosiul
i just did as directed by  you it gives me similer error ;-(

[root@rhce etc]# gedit  named.rfc1912.zones
[root@rhce etc]# gedit named.caching-nameserver.conf
[root@rhce etc]# !ser
service named start
Starting named:
Error in named configuration:
zone ram.com/IN: loading master file ram.zone: file not found
_default/ram.com/IN: file not found
zone 1.168.192.in-addr.arpa/IN: loading master file rev.zone: file not found
_default/1.168.192.in-addr.arpa/IN: file not found
                                                           [FAILED]

see my zones

[root@rhce named]# ls
data              named.broadcast  named.local  rev.zone
localdomain.zone  named.ca         named.zero   rndc.key
localhost.zone    named.ip6.local  ram.zone     slaves
[root@rhce named]# pwd
/var/named/chroot/var/named

My new cahing-nameserver and named.conf file"s contents are attached in code snippests pls see
I wonder what is wrong now..

// named.rfc1913.zones:

//

// Provided by Red Hat caching-nameserver package 

//

// ISC BIND named zone configuration for zones recommended by

// RFC 1912 section 4.1 : localhost TLDs and address zones

// 

// See /usr/share/doc/bind*/sample/ for example named configuration files.

//

zone "." IN {

	type hint;

	file "named.ca";

};
 

zone "localdomain" IN {

	type master;

	file "localdomain.zone";

	allow-update { none; };

};
 

zone "localhost" IN {

	type master;

	file "localhost.zone";

	allow-update { none; };

};
 

zone "0.0.127.in-addr.arpa" IN {

	type master;

	file "named.local";

	allow-update { none; };

};
 

zone "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 {

        type master;

	file "named.ip6.local";

	allow-update { none; };

};
 

zone "255.in-addr.arpa" IN {

	type master;

	file "named.broadcast";

	allow-update { none; };

};
 

zone "0.in-addr.arpa" IN {

	type master;

	file "named.zero";

	allow-update { none; };

};
 

zone "ram.com" IN {

      type master;

      file "ram.zone";

      allow-update { any; };
 

};
 
 

zone "1.168.192.in-addr.arpa" IN {

        type master;

        file "rev.zone";

        allow-update { any; };

};
 
 
 
 

!!!!Now see my  NAMED.CAHING-NAMESERVER file contents!!!
 

options {

	listen-on port 53 { 127.0.0.1; 192.168.1.250; };

	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";

	query-source    port 53;	

	query-source-v6 port 53;

	allow-query     { localhost; any; };

};
 

logging {

        channel default_debug {

                file "data/named.run";

                severity dynamic;

        };

};

view localhost_resolver {

	match-clients 	   { localhost; any; };

	match-destinations { localhost; any; };

	recursion yes;

	include "/etc/named.rfc1912.zones";

};

Open in new window

0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Ok just do a quck check

cd /etc

ls - l

do you have this 2 files

lrwxrwxrwx   1 root named     52 Jan 20 08:47 named.caching-nameserver.conf -> /var/named/chroot//etc/named.caching-nameserver.conf
lrwxrwxrwx   1 root named     42 Jan 20 08:47 named.rfc1912.zones -> /var/named/chroot//etc/named.rfc1912.zones
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
yeah lots of :-D


[root@rhce etc]# ls -l named.*

lrwxrwxrwx 1 root named   52 Apr  3 20:05 named.caching-nameserver.conf -> /var/named/chroot//etc/named.caching-nameserver.conf

-rw-r----- 1 root named 1100 Jan 17  2007 named.caching-nameserver.conf.2009-04-03_20-05-04.495876556

lrwxrwxrwx 1 root named   52 Apr  3 20:04 named.caching-nameserver.conf.rpmorig -> /var/named/chroot//etc/named.caching-nameserver.conf

lrwxrwxrwx 1 root named   33 Apr  3 20:04 named.conf -> /var/named/chroot//etc/named.conf

lrwxrwxrwx 1 root named   42 Apr  3 20:05 named.rfc1912.zones -> /var/named/chroot//etc/named.rfc1912.zones

lrwxrwxrwx 1 root named   42 Apr  3 20:04 named.rfc1912.zones.rpmorig -> /var/named/chroot//etc/named.rfc1912.zones

Open in new window

0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
now I hve deleted that named.conf file but error is same there
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
ommmm little bit of stuck now..

Ok Delte this 2 zone then restart , see if you see any other error or if its start or not ...


zone "ram.com" IN {
      type master;
      file "ram.zone";
      allow-update { any; };
 
};
 
 
zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "rev.zone";
        allow-update { any; };
};
 
then will take one by one ...
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
Ok....just see this output

[root@rhce named]# rm -rf ram.zone
[root@rhce named]# rm -rf rev.zone
[root@rhce named]# service named restart
Stopping named:                                            [FAILED]
Starting named:
Error in named configuration:
zone ram.com/IN: loading master file ram.zone: file not found
_default/ram.com/IN: file not found
zone 1.168.192.in-addr.arpa/IN: loading master file rev.zone: file not found
_default/1.168.192.in-addr.arpa/IN: file not found
                                                           [FAILED]
[root@rhce named]#

but i wonder  what was wrong there in these files???
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
no!!

i said delete the zone file info from named.rfc1912.zones file,

i just want to see the bind is gettign zone info from named.rfc1912.zones

have you done this ??
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
I will be off for 3 hours, , my office is finished, will have to go home

so i will be able to check again after 3 hours

sorry for this
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
iam getting almost mad now...LoL
i have deleted those zone from named.rfc... file and rebooted the system they  are not here but still it gives same error
[root@rhce ~]# !serv
service named restart
Stopping named:                                            [FAILED]
Starting named:
Error in named configuration:
zone ram.com/IN: loading master file ram.zone: file not found
_default/ram.com/IN: file not found
zone 1.168.192.in-addr.arpa/IN: loading master file rev.zone: file not found
_default/1.168.192.in-addr.arpa/IN: file not found
                                                           [FAILED]

Unbelivable...belive it!!!
error.JPG
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
Okey man...Thanks for being with me ;-)
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
All done now :-) i made an another virtual machine and did the whole process again its working 100% but when i made its slave dns server the slave server got the zones afet staring the named service its resolving on behind of ram.com but problm is its not getting updates of newly changed values like i added an new pc name
station15  IN A 192.168.1.10
in forward file
and in reverse zone
station15 IN PTR station15.ram.com.

i changes the serial in master server which ram.com in both forward and reverse zones from  20090441  to 20090442 and restarted the service at both ends it still doesnt takes the updates
can u pls me what shold i change to get it done?
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
Any Expert thre? ;-)
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
Do you have allow-transfer set?  Do you have notify set to no?

Hopefully, you realize that we can not see what you have and can only go on what information you provide.
Post the named.conf files from both.

Make sure that the server setup as slave, references the correct IP for the master as well as being able to get there.
Check whether you have notify option defined globally (at the top of the named.conf file) or per zone within the zone definition.

When changes are made there is no need to reload the service, if properly configured, you can use rndc to reload the zone
rndc reload ram.com
Make sure that the update you made is not being rejected because of errors.
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
Thanks for reply arnold,
i dont have named.conf  its working on named.cachin.conf and named.rfc... and there is no allow-tranfer set pls modify my named files as needed.
named.caching-nameserver.txt
named.caching-nameserve.txt
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 1

Author Comment

by:vmware420
Comment Utility
iam also attaching named.rfc... file please check it .
named.rfc1912.txt
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
Caching servers do not have authoritative zones.  Their updates will comply with the zone settings for Refresh, and TTL expiration.

Updates upon changes to the zone only occurs on the Authoritative Name server master when the change is made and rndc reload zone_name is issued or on the slave server upon receipt of notify from the master or based on the Refresh/TTL of the zone.

0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Hi good morning
I am really sorry due to weaknd i went to a quick holiday...
hence was off.

do you still need help ?? or your problem is solved? let me know then will take it from their ..
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
Hi Fosiul,

pls see comment id 24064846 its still not solved !!

0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Ok in named.rfc... in Master Dns server


Delete forward, i never used it ..

zone "ram.com" IN {
        type master;
        allow-update { any; };
        Allow-transfer { ip_of_secondary_server ; } ;

};

then restart both ..

check the log to see is there any error or not
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
Thanks
but before doing this...dont u think so its essential to put an directive for zone file location  which i named as "forward"

zone "ram.com" IN {
        type master;
        allow-update { any; };
        file "forward";
        Allow-transfer { ip_of_secondary_server ; } ;

};
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
omm I need to look at what is forward,if you want keep forwrd,
but put allow-transfer { ip  ; };

after that see what happended..

and in slave dns server

change as necessary :

zone "ram.com" IN {
      type slave;
      file "ram.zone";
      masters { ip_master_server; };
}
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
man... forward is just an name of forward zone and reverse is the name of reverse zone :-)....and i just tried it it didnt work...slave is resolving but zone hasnt been updated yet its still showing old serial no.
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Ok is there any error in both Side log ??
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
:-) its updating now but do i need to always restart the named service on slave to get updates? arnold above suggest to use rndc reload ram.zone command but that didnt work...
and one last thing i see an very weird file inside my /var/named/chroot/var/named/slaves dir pls see the attached pix for all of the queries ;-)
er.JPG
0
 
LVL 29

Assisted Solution

by:fosiul01
fosiul01 earned 62 total points
Comment Utility
Slaves does not update zone record as soon as you changed the zone record ,

use setup refresh time 0 seconds

used any thing more then 0

what error you want me to see in slaves

its currently empty ..

are you expteting any file ??
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
ohh sorry i dinto check properly

are you asking about DB-ht file ???

if you delte this file, and if you restart bind again, does it create automaticaly??
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
Slave server schedule the refresh if they receive a Notify from the master server that a change has occured.  Do not set referesh on the zone to 0.

Your problem is that you only have the master server listed in the zone:
NS ns.ram.com

The notify process is based on the NS record.  The DNS server sends Notify events to each NS entry.

Add
NS [slave_server]
And you see the update take effect within a short time of the change.
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Miss type  : "use setup refresh time 0 seconds"  i meant, I never use setup refresh time 0 seconed, use any thing more then 0

0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
Actually it  containing same data as ram.zone file has see the attached pix
I have refresh time set to 0 but i still need to restart the service y?

Thanks
23.JPG
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
No, Refresh time set to 0 , would not work

you will have to refresh time more then  0

the db file containning your reverese zone entry

can you attched named.rfc .. from Mastr dns and slave dns server
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
You need to have both Name servers listed under the NS record in the zone.

The zone must look identical this is the whole point of slave/master zones.
The server setup as slave, reflect the exact same information as exists on the master.
When changes made to a zone, named generates a Notify to each NS designated server.  Once a server receives the Notify and is configured as Slave, the zone is taged as expired and a refresh is scheduled.  Since you only have one zone, the refresh should happen no more than a minute.
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
Ok guys problems are solved 99 percent thanks both of you...just one LAST thing i need to add an MX record for ip 192.168.1.25 how shold it look like in both forward and reverse zone....i assure you i wont trouble you more ;-)
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
MX record will have to define only ram.zone file
not in  reverse zone .
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
Why do you need an MX for the reverse zone.
MX only applies to user@domain
mx preference(lower number higher preference) hostname
ram.com. IN mx 0 mail
mail IN A 192.168.1.25

In the reverse zone:
25 IN PTR mail.ram.com
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
an kid trapped between two Big guys :-D...LoL
one guy is saying no MX for reverse zone one is saying yes...actually iam gonna make an mail server tonight thts y i asked
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
MX is a record that defines a Mail Exchanger/Server.

PTR is how you give a name to the IP.

Even though you are using private IP spaces for your "ram.com" zone.

It is a good practice to always match Forward and reverse zones.
i.e. an A record in the forward zone should be matched with a PTR record in the reverse zone.
MX is not a record that has a reverse mapping.

In order for an MX to work in a reverse zone (using your IP), the mailing needs to be to an address of the form user@1.168.192.in-addr.arpa.

 
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Ommmm,

take Arnold advise,

because all my Zone recorods are for public server. and Ptr record created by Isp

I almost forgot theoritacally create zone record for Internal pcs,

and arnold he is good in theoriticaly


0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
yeah...he is really good thanks to him and you...man..iam puzzle now to who i shold give points...actually your helpfulness is pricless but you both guys deserve...equal points but i dont know how... i can do it :-( any Mod dude pls help me out
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
You have the option to split points and then select among which posts you want the points split and in what proportion as well as selecting a post that is the answer to your question while the other selected posts will be the assisting answers.

Could not find the appropriate FAQ for point award issues.
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
its not showing me an option for spliting poits in two exprts see the attached pix
pp.JPG
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
hahaah LOL

under  every post you will see button call

Accept Multiple solution or Spilit ....   [ forgot ..]


just click on their, and assign poits, [ dont worry about point too much ]
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
have a look this one

http://www.experts-exchange.com/help.jsp
Under point section -> can i spilit the points
0
 
LVL 1

Author Comment

by:vmware420
Comment Utility
ooooh man....i did mistake iam really sorry i chose both arnold in mistake ....i wanna give to Fosiul too wtf ....sorry Fosiul i will ask to sort to Mod
0
 
LVL 1

Author Closing Comment

by:vmware420
Comment Utility
Thanks both of you for yours knowledge and honesty keep them up Bye...: -)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I wrote this article to explain some important DNS concepts that should be known to avoid some typical configuration errors I often see in forums. I assume that what is described here is the typical behavior of Microsoft DNS client. I don't know …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

771 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

10 Experts available now in Live!

Get 1:1 Help Now