named permission issues

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
KASherry
Posts: 3
Joined: 2013/06/28 02:24:58

named permission issues

Post by KASherry » 2013/06/28 02:45:39

I am currently trying to install and configure BIND on a minimal install of CentOS 5.8 as an autoratiative server on my local network.

I am at a point were named is failing to start due to a fatal error. I am at a total loss and have been at this for about a week. I understand the theory of DNS however the config is alluding me...

[root@localhost etc]# service named restart
Stopping named: [ OK ]
Starting named: [FAILED]
[root@localhost etc]#

[root@localhost etc]# tail -f /var/log/messages
Jun 27 22:23:24 localhost named[5949]: loading configuration: permission denied
Jun 27 22:23:24 localhost named[5949]: exiting (due to fatal error)
Jun 27 22:40:29 localhost named[6021]: starting BIND 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.6 -u named
Jun 27 22:40:29 localhost named[6021]: adjusted limit on open files from 1024 to 1048576
Jun 27 22:40:29 localhost named[6021]: found 1 CPU, using 1 worker thread
Jun 27 22:40:29 localhost named[6021]: using up to 4096 sockets
Jun 27 22:40:29 localhost named[6021]: loading configuration from '/etc/named.conf'
Jun 27 22:40:29 localhost named[6021]: none:0: open: /etc/named.conf: permission denied
Jun 27 22:40:29 localhost named[6021]: loading configuration: permission denied
Jun 27 22:40:29 localhost named[6021]: exiting (due to fatal error)

[root@localhost etc]# cat ./named.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
//
options {
listen-on port 53 { 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 { localhost; };
allow-query-cache { localhost; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
#view localhost_resolver {
# match-clients { localhost; };
# match-destinations { localhost; };
# recursion yes;
# include "/etc/named.rfc1912.zones";
#};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "localhost.zone";
};
zone "0.0.127.IN-ADDR.ARPA" IN {
type master;
file "named.localhost";
};
zone "exampleKS.fzone" IN {
type master;
file "exampleKS.fzone";
};

[root@localhost etc]#


Can anyone offer any advice or guidance?

KASherry
Posts: 3
Joined: 2013/06/28 02:24:58

Re: named permission issues

Post by KASherry » 2013/06/28 02:48:36

Also the output of named-checkconf and named-checkzone respectivly:

[root@localhost etc]# !named-checkconf
named-checkconf ./named.conf
[root@localhost etc]# named-checkconf ./named.conf
[root@localhost etc]# !named-checkzone
named-checkzone exampleKS.fzone ./named.conf
dns_master_load: ./named.conf:2: unexpected end of line
dns_master_load: ./named.conf:1: unexpected end of input
dns_master_load: ./named.conf:4: unexpected end of line
dns_master_load: ./named.conf:3: unexpected end of input
./named.conf:5: unknown RR type 'ISC'
./named.conf:6: unknown RR type 'as'
dns_master_load: ./named.conf:8: unexpected end of line
dns_master_load: ./named.conf:7: unexpected end of input
dns_master_load: ./named.conf:10: unexpected end of line
dns_master_load: ./named.conf:9: unexpected end of input
./named.conf:11: unknown RR type 'to'
./named.conf:12: unknown RR type 'caching-nameserver'
dns_master_load: ./named.conf:14: unexpected end of line
dns_master_load: ./named.conf:13: unexpected end of input
./named.conf:15: unknown RR type 'listen-on'
./named.conf:16: unknown RR type 'listen-on-v6'
./named.conf:17: unknown RR type 'directory'
dns_master_load: ./named.conf:17: syntax error
dns_master_load: ./named.conf:17: syntax error
./named.conf:18: unknown RR type 'dump-file'
dns_master_load: ./named.conf:18: syntax error
dns_master_load: ./named.conf:18: syntax error
./named.conf:19: unknown RR type 'statistics-file'
dns_master_load: ./named.conf:19: syntax error
dns_master_load: ./named.conf:19: syntax error
./named.conf:20: unknown RR type 'memstatistics-file'
dns_master_load: ./named.conf:20: syntax error
dns_master_load: ./named.conf:20: syntax error
./named.conf:22: unknown RR type '//'
./named.conf:23: unknown RR type '//'
./named.conf:24: unknown RR type '//'
./named.conf:25: unknown RR type '//'
./named.conf:27: unknown RR type 'allow-query'
./named.conf:28: unknown RR type 'allow-query-cache'
dns_master_load: ./named.conf:30: unexpected end of line
dns_master_load: ./named.conf:29: unexpected end of input
./named.conf:31: unknown RR type 'channel'
./named.conf:32: unknown RR type 'file'
dns_master_load: ./named.conf:32: syntax error
dns_master_load: ./named.conf:32: syntax error
./named.conf:33: unknown RR type 'severity'
./named.conf:34: unknown RR type '}'
dns_master_load: ./named.conf:36: unexpected end of line
dns_master_load: ./named.conf:35: unexpected end of input
./named.conf:37: unknown RR type 'match-clients'
./named.conf:38: unknown RR type 'match-destinations'
./named.conf:39: unknown RR type 'recursion'
./named.conf:40: unknown RR type 'include'
dns_master_load: ./named.conf:40: syntax error
dns_master_load: ./named.conf:40: syntax error
dns_master_load: ./named.conf:42: unexpected end of line
dns_master_load: ./named.conf:41: unexpected end of input
dns_master_load: ./named.conf:42: syntax error
dns_master_load: ./named.conf:42: syntax error
./named.conf:43: unknown RR type 'type'
./named.conf:44: unknown RR type 'file'
dns_master_load: ./named.conf:44: syntax error
dns_master_load: ./named.conf:44: syntax error
dns_master_load: ./named.conf:46: unexpected end of line
dns_master_load: ./named.conf:45: unexpected end of input
dns_master_load: ./named.conf:46: syntax error
dns_master_load: ./named.conf:46: syntax error
./named.conf:47: unknown RR type 'type'
./named.conf:48: unknown RR type 'file'
dns_master_load: ./named.conf:48: syntax error
dns_master_load: ./named.conf:48: syntax error
dns_master_load: ./named.conf:50: unexpected end of line
dns_master_load: ./named.conf:49: unexpected end of input
dns_master_load: ./named.conf:50: syntax error
dns_master_load: ./named.conf:50: syntax error
./named.conf:51: unknown RR type 'type'
./named.conf:52: unknown RR type 'file'
dns_master_load: ./named.conf:52: syntax error
dns_master_load: ./named.conf:52: syntax error
dns_master_load: ./named.conf:54: unexpected end of line
dns_master_load: ./named.conf:53: unexpected end of input
dns_master_load: ./named.conf:54: syntax error
dns_master_load: ./named.conf:54: syntax error
./named.conf:55: unknown RR type 'type'
./named.conf:56: unknown RR type 'file'
dns_master_load: ./named.conf:56: syntax error
dns_master_load: ./named.conf:56: syntax error
dns_master_load: ./named.conf:58: unexpected end of line
dns_master_load: ./named.conf:57: unexpected end of input
zone exampleKS.fzone/IN: loading master file ./named.conf: unexpected end of input
[root@localhost etc]#

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

named permission issues

Post by TrevorH » 2013/06/28 08:25:34

Your first problem is:

[quote]
Jun 27 22:40:29 localhost named[6021]: none:0: open: /etc/named.conf: permission denied
[/quote]

So your named process, which runs with the user 'named', cannot read /etc/named.conf. The file here looks like this

[code]
-rw-r----- 1 root named 1051 Oct 1 2012 /etc/named.conf
[/code]

KASherry
Posts: 3
Joined: 2013/06/28 02:24:58

Re: named permission issues

Post by KASherry » 2013/06/28 21:56:16

I had to make some changes to the zone files and the conf and then I set the file as this:

-rw-r----- 1 named root 1513 Jun 28 17:34 named.conf

named is started successfully however I sure I still have some troubleshooting to work on.
Thanks for the help!

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: named permission issues

Post by TrevorH » 2013/06/29 00:36:41

You have the owner and group the wrong way round on that: Yours is owned by named with group access by root. It should be the other way around.

Post Reply