Discussion:
could not start named.conf
Adriatik Allamani
2007-08-13 11:06:46 UTC
Permalink
Hi

I configured a Server to use as DNS.
I am trying to start named.conf but it does not start:

Aug 13 12:02:54 ns1 named[4449]: starting BIND 9.2.4
Aug 13 12:02:54 ns1 named[4449]: using 2 CPUs
Aug 13 12:02:54 ns1 named[4449]: loading configuration from
'/etc/named.conf'
Aug 13 12:02:54 ns1 named[4449]: listening on IPv4 interface lo,
127.0.0.1#53
Aug 13 12:02:54 ns1 named[4449]: listening on IPv4 interface eth0,
217.24.249.76#53
Aug 13 12:02:54 ns1 named[4449]: command channel listening on
127.0.0.1#953
Aug 13 12:02:54 ns1 named[4449]: couldn't open pid file
'/var/run/named/named.pid': Permission denied
Aug 13 12:02:54 ns1 named[4449]: exiting (due to early fatal error)


My named.conf file is below:


options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";

// query-source address * port 53;
};


controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

zone "." IN {
type hint;
file "named.ca";
};

zone "info.al" IN {
type master;
file "db.adrial.com";

};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "db.127.0.0";

};



Can someone help me in this please?


Thanks

P.S: I was log as root. The named.conf is located in /etc
--
Adriatik ALLAMANI
Specialist of Information Technology Sector
Tirana / Albania
Telephone: 00 355 4 250 926
Fax: 00 355 4 259 106
Adam Tkac
2007-08-13 11:26:43 UTC
Permalink
Post by Adriatik Allamani
Hi
I configured a Server to use as DNS.
Aug 13 12:02:54 ns1 named[4449]: starting BIND 9.2.4
Aug 13 12:02:54 ns1 named[4449]: using 2 CPUs
Aug 13 12:02:54 ns1 named[4449]: loading configuration from
'/etc/named.conf'
Aug 13 12:02:54 ns1 named[4449]: listening on IPv4 interface lo,
127.0.0.1#53
Aug 13 12:02:54 ns1 named[4449]: listening on IPv4 interface eth0,
217.24.249.76#53
Aug 13 12:02:54 ns1 named[4449]: command channel listening on
127.0.0.1#953
Aug 13 12:02:54 ns1 named[4449]: couldn't open pid file
'/var/run/named/named.pid': Permission denied
Aug 13 12:02:54 ns1 named[4449]: exiting (due to early fatal error)
BIND can't manipulate with his pid file. Check if your /var/run/named
and /var/run/named/named.pid has correct perms.

Adam
Post by Adriatik Allamani
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
// query-source address * port 53;
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "info.al" IN {
type master;
file "db.adrial.com";
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "db.127.0.0";
};
Can someone help me in this please?
Thanks
P.S: I was log as root. The named.conf is located in /etc
Adriatik Allamani
2007-08-13 15:29:50 UTC
Permalink
Post by Adam Tkac
Post by Adriatik Allamani
Hi
I configured a Server to use as DNS.
Aug 13 12:02:54 ns1 named[4449]: starting BIND 9.2.4
Aug 13 12:02:54 ns1 named[4449]: using 2 CPUs
Aug 13 12:02:54 ns1 named[4449]: loading configuration from
'/etc/named.conf'
Aug 13 12:02:54 ns1 named[4449]: listening on IPv4 interface lo,
127.0.0.1#53
Aug 13 12:02:54 ns1 named[4449]: listening on IPv4 interface eth0,
217.24.249.76#53
Aug 13 12:02:54 ns1 named[4449]: command channel listening on
127.0.0.1#953
Aug 13 12:02:54 ns1 named[4449]: couldn't open pid file
'/var/run/named/named.pid': Permission denied
Aug 13 12:02:54 ns1 named[4449]: exiting (due to early fatal error)
BIND can't manipulate with his pid file. Check if your /var/run/named
and /var/run/named/named.pid has correct perms.
Adam
Permission for /var/run/named is:

drwxrwx--- 2 named named 4096 Jul 24 18:51 named

Inside the /var/run/named directory has no named.pid, it is empty I
think??

when I get in the folder, it has nothing. And ls -l command shows:

total 0


Thanks
Adriatik
Post by Adam Tkac
Post by Adriatik Allamani
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
// query-source address * port 53;
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "info.al" IN {
type master;
file "db.adrial.com";
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "db.127.0.0";
};
Can someone help me in this please?
Thanks
P.S: I was log as root. The named.conf is located in /etc
Chris Buxton
2007-08-13 17:19:18 UTC
Permalink
Post by Adriatik Allamani
Post by Adriatik Allamani
Aug 13 12:02:54 ns1 named[4449]: couldn't open pid file
'/var/run/named/named.pid': Permission denied
drwxrwx--- 2 named named 4096 Jul 24 18:51 named
Inside the /var/run/named directory has no named.pid, it is empty I
think??
total 0
Are you starting named manually, or using the init script?

Based on your BIND version and the location of the PID file, I'm
going to guess you're using RHEL 4, CentOS 4, or some equivalent
version of Fedora or other RH-derived OS. In which case, you should
be using the following to start the service:

service named start

If you choose to start it manually, make sure that you put "-u named"
on the command line to change the process' user account to "named".
Otherwise, you will get the error message above - the root user
(after dropping superuser privileges) is unable to write to that
directory.

Chris Buxton
Men & Mice
Adriatik Allamani
2007-08-14 06:30:02 UTC
Permalink
Thanks a lot for the help. To all of you.
Post by Chris Buxton
Post by Adriatik Allamani
Post by Adriatik Allamani
Aug 13 12:02:54 ns1 named[4449]: couldn't open pid file
'/var/run/named/named.pid': Permission denied
drwxrwx--- 2 named named 4096 Jul 24 18:51 named
Inside the /var/run/named directory has no named.pid, it is empty I
think??
total 0
Are you starting named manually, or using the init script?
Based on your BIND version and the location of the PID file, I'm
going to guess you're using RHEL 4, CentOS 4, or some equivalent
version of Fedora or other RH-derived OS. In which case, you should
service named start
This command is not recognized, when I try to start with: service named
start
it comes out:
bash: service: command not found

And "yes" I using CentOS4.
So I use to start manually and now it comes out this error:

Aug 14 07:22:33 ns1 named[4172]: starting BIND 9.2.4 -u named
Aug 14 07:22:33 ns1 named[4172]: using 2 CPUs
Aug 14 07:22:33 ns1 named[4172]: loading configuration from
'/etc/named.conf'
Aug 14 07:22:33 ns1 named[4172]: /etc/named.conf:12: 'directory'
redefined near 'directory'
Aug 14 07:22:33 ns1 named[4172]: loading configuration: already exists
Aug 14 07:22:33 ns1 named[4172]: exiting (due to fatal error)


named.conf file is below?

options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";

// Process environment
// directory "/local/var/named/run"; // Working directory
directory "/run"; // Working directory
(chroot'd)
pid-file "named.pid"; // Put pid file in working
directory

/*
* 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 address * port 53;
};

controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

zone "." IN {
type hint;
file "named.ca";
};

zone "info.al" IN {
type master;
file "db.adrial.com";

};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "db.127.0.0";

};
Post by Chris Buxton
If you choose to start it manually, make sure that you put "-u named"
on the command line to change the process' user account to "named".
Otherwise, you will get the error message above - the root user
(after dropping superuser privileges) is unable to write to that
directory.
Chris Buxton
Men & Mice
Niall O'Reilly
2007-08-13 11:21:09 UTC
Permalink
Post by Adriatik Allamani
Aug 13 12:02:54 ns1 named[4449]: couldn't open pid file
'/var/run/named/named.pid': Permission denied
Aug 13 12:02:54 ns1 named[4449]: exiting (due to early fatal error)
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
// query-source address * port 53;
};
Where do you actually want the PID file: in /var/named or in
/var/run/named ?

Whichever directory you choose must exist and be writable.

I suggest adding the option

pid-file "named.pid";

This will force the PID file to be in the directory specified
in the 'directory' option (/var/named).

/Niall
Mordechai T. Abzug
2007-08-13 11:56:29 UTC
Permalink
Post by Niall O'Reilly
I suggest adding the option
pid-file "named.pid";
This will force the PID file to be in the directory specified
in the 'directory' option (/var/named).
If the original poster is using someone else's named start/stop script
(including one provided by his/her OS/distribution), then he/she may
need the pid file location to match the one specified in the
start/stop script.

- Morty
Adriatik Allamani
2007-08-13 15:04:06 UTC
Permalink
Thanks for the help.


I added the line:

};

pid-file "/var/named/named.pid";

};

in the named.conf file. But it comes again with errors:
Aug 13 16:00:46 ns1 named[4142]: starting BIND 9.2.4
Aug 13 16:00:46 ns1 named[4142]: using 2 CPUs
Aug 13 16:00:46 ns1 named[4142]: loading configuration from
'/etc/named.conf'
Aug 13 16:00:46 ns1 named[4142]: /etc/named.conf:43: unknown option
'pid-file'
Aug 13 16:00:46 ns1 named[4142]: loading configuration: failure
Aug 13 16:00:46 ns1 named[4142]: exiting (due to fatal error)


Actually I am not good in Linux.


Thanks
Post by Niall O'Reilly
Post by Adriatik Allamani
Aug 13 12:02:54 ns1 named[4449]: couldn't open pid file
'/var/run/named/named.pid': Permission denied
Aug 13 12:02:54 ns1 named[4449]: exiting (due to early fatal error)
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
// query-source address * port 53;
};
Where do you actually want the PID file: in /var/named or in
/var/run/named ?
Whichever directory you choose must exist and be writable.
I suggest adding the option
pid-file "named.pid";
This will force the PID file to be in the directory specified
in the 'directory' option (/var/named).
/Niall
Adriatik ALLAMANI
Specialist of Information Technology Sector
Telecommunications Regulatory Entity - TRE
"Reshit Çollaku" Str, No. 43
PO. Box: 253/1
Tirana / Albania
Telephone: 00 355 4 250 926
Fax: 00 355 4 259 106
Email: ***@ert.gov.al
www.ert.gov.al
Niall O'Reilly
2007-08-13 16:08:30 UTC
Permalink
Did you put it in the 'options' block, like this extract from my
running system?

options {

// Process environment
// directory "/local/var/named/run"; // Working directory
directory "/run"; // Working directory (chroot'd)
pid-file "named.pid"; // Put pid file in working
directory

// more options ...

};

Perhaps you need to read the documentation ... ?

/Niall
Adriatik Allamani
2007-08-14 07:13:34 UTC
Permalink
Hi

I checked the named.conf file with:
/usr/sbin/named-checkconf

And it comes out with error:
/etc/named.conf:12: 'directory' redefined near 'directory'

That I think it was the problem of redefined 'directory' again in the
configuration.

I removed the line '12'. Now the named-checkconf shows no error.

But it does not start again

Aug 14 08:04:29 ns1 named[6033]: starting BIND 9.2.4 -u named
Aug 14 08:04:29 ns1 named[6033]: using 2 CPUs
Aug 14 08:04:29 ns1 named[6033]: loading configuration from
'/etc/named.conf'
Aug 14 08:04:29 ns1 named[6033]: listening on IPv4 interface lo,
127.0.0.1#53
Aug 14 08:04:29 ns1 named[6033]: listening on IPv4 interface eth0,
217.24.249.76#53
Aug 14 08:04:29 ns1 named[6033]: command channel listening on
127.0.0.1#953
Aug 14 08:04:29 ns1 named[6033]: couldn't open pid file 'named.pid':
Permission denied
Aug 14 08:04:29 ns1 named[6033]: exiting (due to early fatal error)

The permission thing again?

below is the named.conf file.

options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";

// Process environment

pid-file "named.pid"; // Put pid file in working
directory

Thanks
Adriatik Allamani
Post by Niall O'Reilly
Did you put it in the 'options' block, like this extract from my
running system?
options {
// Process environment
// directory "/local/var/named/run"; // Working directory
directory "/run"; // Working directory (chroot'd)
pid-file "named.pid"; // Put pid file in working
directory
// more options ...
};
Perhaps you need to read the documentation ... ?
/Niall
Continue reading on narkive:
Loading...