named.conf issue

Zervun

Verified User
Joined
Jun 28, 2007
Messages
18
Today I did a yum update and DA broke - I checked the services list and named was failing a load.

The error it was giving was

Code:
Starting named:
Error in named configuration:
zone localhost/IN: loading master file localhost.zone: file not found
_default/localhost/IN: file not found
zone 0.0.127.in-addr.arpa/IN: loading master file named.local: file not found
_default/0.0.127.in-addr.arpa/IN: file not found

I then checked in /var/named and localhost.zone and named.local were missing

After reading a post on here it appears that since it is a non caching nameserver (I didn't have my server in resolv.conf I have only the two opendns servers) that it was ok to not have those there

So my question is - I commeted out named.conf by doing

Code:
/*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; };
};
*/

Is it ok to do that? I'm somewhat puzzled why yum update would have broken that since it has the proper excludes named* for da stuff

My server is running fine, named started fine with the above commenting out, but I'd still like to figure out why this happened and if it will affect me in the future
 
Code:
Error in named configuration:
zone localhost/IN: loading master file localhost.zone: file not found
_default/localhost/IN: file not found
zone 0.0.127.in-addr.arpa/IN: loading master file named.local: file not found
_default/0.0.127.in-addr.arpa/IN: file not found
localhost.zone
The master localhost zone file -- localhost.zone -- is provided with the standard distributions of Linux OS such as CentOS or Fedora, etc. This file is a model of brevity and very cryptic! localhost.zone should not by modification. The master.localhost file maps the name 'localhost' to the local or loopback address (127.0.0.1), and used by many system programs.

named.local
This file specifies the PTR record for the local loopback interface, better known as localhost, whose network address is 127.0.0.1. The location of this file is specified in the boot file. It is vitally important to the proper operation of every name server that the 127.0.0.1 address have a PTR record pointing back to the name ``localhost.''.

As you can see these are, to some extent, crucial files for BIND. That said, I suggest you find copies of localhost.zone and named.local and put them back on your server.
 
I'm somewhat puzzled why yum update would have broken that since it has the proper excludes named* for da stuff
Does your yum config file exclude the caching nameserver entry?

What's the output of:
Code:
$ ls -al named.conf*

Jeff
 
here is my yum.conf file

I never checked before this to see if localhost.zone or named.local exsisting - I find it odd that yum would remove those

my server is a basic centos 5 64bit install

Code:
[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800
throttle=64k

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

exclude=apache* httpd* mod_* mysql* MySQL* da_* *ftp* exim* sendmail* php* named*
 
It's likely that since you're not excluding the cacheing nameserver, yum has updated BIND to use it.

That update would add references to those files. It probably installed something like named.conf.rpmnew, but didn't install it. Don't install it; it'll break other things.

Removing references to those files means of course that your instance of BIND won't work as a caching nameserver.

It probably hasn't been doing that anyway, but check to see what your /etc/resolv.conf file points to.

Jeff
 
my resolve.conf points to the opendns servers I set up

Code:
search com
nameserver 208.67.222.222
nameserver 208.67.220.220

When I set up the server I set those up, so I don't need a caching nameserver (I think anyway)

should I add the caching nameserver to the excludes in yum.conf? - I'm a tad confused though I have named* already excluded and I thought to make it caching you just adjust the named.conf

Thanks for the help
 
I have just seen the same effect on my staging centos 5 box after a yum update (with named* in yum exclude) . Thanks for the tip Zeveron to get named going again. But looking at my other centos 5 boxes yet to update I see no localhost.zone or named.local files in /var/named so I don't think the update has removed them.

Can anyone help with a robust repeatable process for updating centos 5 boxes to avoid the need for commenting out code and keeping the configs standard.
 
backup ALL your DNS.

On CentOS:

/etc/named.conf
/etc/sysconfig/named

and the entire /var/named path (or if you've got chrooted BIND, wherever it points to.

Then if you've got chrooted BIND do what you see here.

Then using yum, check the rpm installs:
Code:
# rpm -qa | grep nameserver
rpm -qa | grep bind
and delete the chroot rpm and the cacheing nameserver rpm.

Then add the necessary rpm package names to the exclude line to keep them from getting installed again.

Then restore your backups if required.

If you don't think you're familiar enough with server administration and BIND, hire someone to do it for you; this is dangerous stuff to break.

Jeff
 
Had the same problem after yum upgrading today. Bind seemed to changed to chrooted Bind.

Fixed it using:

http://help.directadmin.com/item.php?id=128

But when I want to reload named in de DA control panel under the 'Service monitor' option I get the following response:

An error has occurred

Details

/sbin/service named reload 2>&1

Issuing the command as user root on the command line seems to work. Restarting named (instead of reloading) also works normally in the DA interface.

I can't find anything in the DA logs. Maybe the rpm install of yum has reset a specific permission flag?
 
Run the line from without the error redirection; i.e.:
Code:
# /sbin/service named reload
to see the error message being returned.

Jeff
 
That's the strange part, this works OK (as root):

[root@server ~]# /sbin/service named reload
Reloading named: [ OK ]
[root@server ~]# tail /var/log/messages
Jun 29 04:02:02 server syslogd 1.4.1: restart.
Jun 29 10:55:17 server named[22601]: loading configuration from '/etc/named.conf'
 
Back
Top