LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-05-2004, 09:12 AM   #1
WiWa
Member
 
Registered: Aug 2003
Distribution: Redhat 9.0, Fedora Core, Suse 9.1, Mandrake
Posts: 82

Rep: Reputation: 15
Bind9 problem: should be easy


I just tried to configure BIND. I've done this many times before, but now sth doesn't work. The mistakes below should be easy to fix, but I just don't see the clue.

In my /etc/named.conf file, you will find:

options {
directory "/var/named";
pid-file "named.pid";
forwarders {
10.0.0.2;
};


When I do: /etc/init.d/named restart, it gives a fail. When I look in the /var/log/messages, I can see:

Jun 5 15:54:10 thorgal1 named[2720]: starting BIND 9.2.2 -t /var/lib/named -u named
Jun 5 15:54:10 thorgal1 named[2720]: using 1 CPU
Jun 5 15:54:10 thorgal1 named[2722]: loading configuration from '/etc/named.conf'
Jun 5 15:54:10 thorgal1 named[2722]: /etc/named.conf:2: change directory to '/var/named' failed: file not found
Jun 5 15:54:10 thorgal1 named[2722]: /etc/named.conf:2: parsing failed
Jun 5 15:54:10 thorgal1 named[2722]: loading configuration: file not found
Jun 5 15:54:10 thorgal1 named[2722]: exiting (due to fatal error)


When I googled, I found that I should do:

options {
directory "/";
pid-file "named.pid";
forwarders {
10.0.0.2;
};

When I do this and I restart named, then it gives the following error:

Jun 5 15:59:26 thorgal1 named[2835]: starting BIND 9.2.2 -t /var/lib/named -u named
Jun 5 15:59:26 thorgal1 named[2835]: using 1 CPU
Jun 5 15:59:26 thorgal1 named[2837]: loading configuration from '/etc/named.conf'
Jun 5 15:59:26 thorgal1 named[2837]: listening on IPv4 interface lo, 127.0.0.1#53
Jun 5 15:59:26 thorgal1 named[2837]: listening on IPv4 interface eth0, 10.0.0.13#53
Jun 5 15:59:26 thorgal1 named[2837]: )could not configure root hints from 'named.ca': file not found
Jun 5 15:59:26 thorgal1 named[2837]: loading configuration: file not found
Jun 5 15:59:26 thorgal1 named[2837]: exiting (due to fatal error)


However, this file is in my /var/named directory/


Any idea on what is wrong here...


For completeness, I attach my named.conf file:

options {
directory "/var/named";
pid-file "named.pid";
forwarders {
10.0.0.2;
};

/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
query-source port 53;
forward only;
recursion yes;
//check-names response warn;
//check-names master warn;
};

//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};


include "/etc/rndc.key";

zone "wauters-mannaert.be" {
type master;
file "/var/named/named.hosts";
};

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

zone "0.0.127.in-addr.arpa" {
type master;
file "/var/named/local.rev";
};

zone "0.0.10.in-addr.arpa" {
type master;
file "/var/named/named.rev";
};


logging {
channel logDNS {
file "/var/log/bind/logDNS.log";
severity info;
print-severity yes;
};
};

Last edited by WiWa; 06-05-2004 at 12:04 PM.
 
Old 06-05-2004, 05:07 PM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
What distro are you trying to set this up on, and do you know if it's trying to chroot named? You should certainly not be making named live in /, since that would give it access to the entire system--something you DON'T want to do with BIND's insecurity record.

It seems that it may be trying to chroot itself and not all the expected files are in the chroot'd environment.
 
Old 06-05-2004, 06:00 PM   #3
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
WiWa

Quote:
Redhat BIND runs normally as the named process as the unprivileged named user.

Fedora takes the added precaution of using Linux's chroot feature to not only run named as user named but also to limit the files named can see. In Fedora, named is fooled into thinking that the directory /var/named/chroot is actually the root or "/" directory. Therefore named files normally found in the /etc directory are found in /var/named/chroot/etc directory instead, and those you'd expect to find in /var/named are actually located in /var/named/chroot/var/named.

Fedora BIND adds to the confusion by correctly installing the files in their non chroot locations, but they are never read.

Note: With Fedora, make copies of your regular and chroot files. The chroot version of named.conf is empty, cut and paste the contents of the /etc version into this file, it is a little safer than copying as the file permissions and ownerships are different too.
Regards

Pete
 
Old 06-06-2004, 05:27 AM   #4
WiWa
Member
 
Registered: Aug 2003
Distribution: Redhat 9.0, Fedora Core, Suse 9.1, Mandrake
Posts: 82

Original Poster
Rep: Reputation: 15
Thanks. The distro I'm trying to set this up is SUSE 9.0. I did (as I had to do with Fedora Core)
"chown named:named /var/named". Could that be causing these probs?

I know in Fedora it's trying to chroot, although I never understood the ins and outs of chroot. In Suse, I had to create the var/named directory myself, so no chroot available.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
emergency bind9 problem Ratclaws Linux - Software 0 09-02-2005 06:13 PM
problem with install BIND9 ! silvercloud Linux - Networking 5 08-20-2005 01:21 AM
BIND9 slave DNS problem HELP!!! mlu Linux - Networking 2 05-05-2005 06:31 AM
Strange Bind9 & Dhcpd3 Problem (stuck here :() Notorious Linux - Software 1 11-09-2004 05:20 PM
Dynamic DHCP/BIND9 connection refused problem aglock Linux - Networking 1 04-05-2004 12:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration