Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
09-14-2004, 06:47 PM
|
#1
|
Member
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219
Rep:
|
Bind9: NDC command failed : rndc: connect failed: connection refused
Well, I've edited my bind9 config using webmin and the mandrake server admin guide (yeah the official one), and I'm getting this error:
NDC command failed : rndc: connect failed: connection refused
I've googled it and did not udnerstnad what was wrong. This is my /var/log/messages :
Sep 15 01:35:19 zeus named[13116]: starting BIND 9.2.3 -u named
Sep 15 01:35:19 zeus named[13116]: using 1 CPU
Sep 15 01:35:19 zeus named: named startup succeeded
Sep 15 01:35:19 zeus named[13116]: loading configuration from '/etc/named.conf'
Sep 15 01:35:19 zeus named[13116]: listening on IPv4 interface lo, 127.0.0.1#53
Sep 15 01:35:19 zeus named[13116]: listening on IPv4 interface eth1, 10.0.0.13#53
Sep 15 01:35:19 zeus named[13116]: couldn't add command channel 127.0.0.1#953: not found
Sep 15 01:35:19 zeus named[13116]: couldn't add command channel ::1#953: not found
Sep 15 01:35:19 zeus named[13116]: couldn't open pid file '/var/run/named.pid': Permission denied
Sep 15 01:35:19 zeus named[13116]: exiting (due to early fatal error)
Sep 15 01:38:31 zeus named: named startup succeeded
Sep 15 01:38:31 zeus named[13196]: starting BIND 9.2.3 -u named
Sep 15 01:38:31 zeus named[13196]: using 1 CPU
Sep 15 01:38:31 zeus named[13196]: loading configuration from '/etc/named.conf'
Sep 15 01:38:31 zeus named[13196]: listening on IPv4 interface lo, 127.0.0.1#53
Sep 15 01:38:31 zeus named[13196]: listening on IPv4 interface eth1, 10.0.0.13#53
Sep 15 01:38:31 zeus named[13196]: couldn't add command channel 127.0.0.1#953: not found
Sep 15 01:38:31 zeus named[13196]: couldn't add command channel ::1#953: not found
Sep 15 01:38:31 zeus named[13196]: couldn't open pid file '/var/run/named.pid': Permission denied
Sep 15 01:38:31 zeus named[13196]: exiting (due to early fatal error)
Sep 15 01:38:32 zeus kernel: martian source 10.0.0.13 from 10.0.0.13, on dev eth1
Sep 15 01:38:32 zeus kernel: ll header: 00:10:22:fd:df:cd:00:90:d0:ae:e2:82:08:00
Sep 15 01:38:32 zeus kernel: Redirect from 10.0.0.138 on eth1 about 10.0.0.13 ignored.
Sep 15 01:38:32 zeus kernel: Advised path = 10.0.0.13 -> 10.0.0.13, tos 00
Sep 15 01:38:34 zeus named[13225]: starting BIND 9.2.3 -u named
Sep 15 01:38:34 zeus named[13225]: using 1 CPU
Sep 15 01:38:34 zeus named: named startup succeeded
Sep 15 01:38:34 zeus named[13225]: loading configuration from '/etc/named.conf'
Sep 15 01:38:34 zeus named[13225]: listening on IPv4 interface lo, 127.0.0.1#53
Sep 15 01:38:34 zeus named[13225]: listening on IPv4 interface eth1, 10.0.0.13#53
Sep 15 01:38:35 zeus named[13225]: couldn't add command channel 127.0.0.1#953: not found
Sep 15 01:38:35 zeus named[13225]: couldn't add command channel ::1#953: not found
Sep 15 01:38:35 zeus named[13225]: couldn't open pid file '/var/run/named.pid': Permission denied
Sep 15 01:38:35 zeus named[13225]: exiting (due to early fatal error)
I don't know why named shouldn't get access to it's own PID file (i tried to start it as root....).
Does anyone recognize this problem (and would that 'anyone' please help me???) ?
My /etc/named.conf:
options {
directory "/etc";
pid-file "/var/run/named.pid";
forwarders {
194.109.6.66;
194.109.9.99;
194.109.104.104;
};
};
zone "." {
type hint;
file "/etc/db.cache";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "/etc/127.0.0.rev";
};
zone "boudewijnector.com" {
type master;
file "/etc/boudewijnector.com.hosts";
};
zone "0.0.10.in-addr.arpa" {
type master;
file "/etc/10.0.0.rev";
};
|
|
|
09-15-2004, 03:55 AM
|
#2
|
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188
Rep:
|
"couldn't open pid file '/var/run/named.pid': Permission denied"
what is the permissions of that file?
ls -l /var/run/named.pid
i think named must be the owner of that file.
"couldn't add command channel 127.0.0.1#953: not found"
there must be some lines about rndc key in /etc/named.conf and /etc/rndc.conf . check them.
|
|
|
09-15-2004, 04:05 AM
|
#3
|
Member
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219
Original Poster
Rep:
|
I just had a look at the PID:
/var/run/named.pid doesn't exist --> var/run/named does . I chown'ed it to named .
About the RNDC conf file; I do not know what to check or where to look so I've posted it. Would you min hinting me where the error is?
RNDC.conf:
options {
default-server localhost;
default-key "key";
};
server localhost {
key "key";
};
key "key" {
algorithm hmac-md5;
secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
};
|
|
|
09-15-2004, 04:22 AM
|
#4
|
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188
Rep:
|
|
|
|
09-15-2004, 04:29 AM
|
#5
|
Member
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219
Original Poster
Rep:
|
Thanks, I'll ahve look in the afternoon 
|
|
|
09-15-2004, 07:42 AM
|
#6
|
Member
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219
Original Poster
Rep:
|
Well, I read the other topic
I don't run it chrooted, and the hostnames are correct... so I don't know what's wrong.
This is /var/log/messages (it's still the same :+) :
Sep 15 14:39:23 zeus named[5089]: starting BIND 9.2.3 -u named
Sep 15 14:39:23 zeus named[5089]: using 1 CPU
Sep 15 14:39:23 zeus named[5089]: loading configuration from '/etc/named.conf'
Sep 15 14:39:23 zeus named[5089]: listening on IPv4 interface lo, 127.0.0.1#53
Sep 15 14:39:23 zeus named[5089]: listening on IPv4 interface eth1, 10.0.0.13#53
Sep 15 14:39:23 zeus named[5089]: couldn't add command channel 127.0.0.1#953: not found
Sep 15 14:39:23 zeus named[5089]: couldn't add command channel ::1#953: not found
Sep 15 14:39:23 zeus named[5089]: couldn't open pid file '/var/run/named.pid': Permission denied
Sep 15 14:39:23 zeus named[5089]: exiting (due to early fatal error)
Anyone's got more ideas?
|
|
|
09-15-2004, 08:01 AM
|
#7
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
You should change the ownership of /var/run to user named so he can write in there it's pid, or chmod it to 777 (bad idea), or better change the named.pid location in named.conf to a directory that user named has the right to write.
|
|
|
09-15-2004, 08:30 AM
|
#8
|
Member
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219
Original Poster
Rep:
|
I've already chown'ed it to 'named'
|
|
|
09-15-2004, 08:49 AM
|
#9
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
For my DNS's (primary and secondary) I have created a /var/named dir owned by the user "named" and in /etc/named.conf there are the lines:
Code:
directory "/var/named";
pid-file "named.pid";
So it creates the named.pid in that directory, where also reside the zone files (you have them sparsed in /etc) and it works flawlessly.
Hope that helps.
|
|
|
09-15-2004, 08:55 AM
|
#10
|
Member
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219
Original Poster
Rep:
|
Hmmpf
Just tried making the new directory in /var/
It already existed  so I chown'ed it to named.
Doesn't work
This is displayed when tying to start named
Code:
[root@zeus var]# service named restart
Stopping named: rndc: connect failed: connection refused
[FAILED]
Starting named: [ OK ]
[root@zeus var]# service named stop
Stopping named: rndc: connect failed: connection refused
[FAILED]
[root@zeus var]#
|
|
|
09-15-2004, 09:03 AM
|
#11
|
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188
Rep:
|
Boudewijn
did u try "rndc-confgen" ?
|
|
|
09-15-2004, 09:07 AM
|
#12
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,221
|
Then chmod 777 /var/named 
|
|
|
09-15-2004, 09:13 AM
|
#13
|
Member
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620
Rep:
|
You have two problems:
1) command channel not defined
Did you add the following to your named.conf file? This is a copy/paste from my named.conf file.
// --------------------------------------------------------------------
// Define the rndc key for rndc command. Use "rndc-confgen -a -b 512"
// to create a new key
// --------------------------------------------------------------------
include "/etc/rndc.key";
// ------------------------------------------------------------------------
// Only allow localhost access from rndc
// ------------------------------------------------------------------------
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
2) couldn't open pid file '/var/run/named.pid'
Since you are starting the named process as user named (which is good), then it needs its own directory structure defined subordinate to /var/run so that it has the proper permisiions to create the pid file. In other words, the default permissions of the /var/run directory do not allow a user other than root to create a file/directory.
[root@excelsior run]# pwd
/var/run
[root@excelsior run]# ls -ld named
drwxrwx--- 2 named named 1024 Mar 26 05:28 named
...and the corresponding named.conf entries from my named.conf file
// ------------------------------------------------------------------------
// Specify any "global" options for named
// ------------------------------------------------------------------------
options {
directory "/var/named";
pid-file "/var/run/named/named.pid";
statistics-file "/var/log/named/named.stats";
dump-file "/var/log/named/named.dump";
zone-statistics yes;
and so on.
|
|
|
09-15-2004, 12:54 PM
|
#14
|
Member
Registered: Nov 2003
Location: The Netherlands
Distribution: MDK: 10,10.1,10_amd64,9.2,9.1 . Debian: sarge,woody, Gentoo (X86 amd64 Sparc)
Posts: 219
Original Poster
Rep:
|
Ok,
I've done what you told me :
Step 2 (was in /var/run/)
[root@zeus run]# pwd
/var/run
[root@zeus run]# ls -ld named
drwxr-xr-x 2 named named 4096 Mar 25 12:35 named/
[root@zeus run]#
named.conf:
// --------------------------------------------------------------------
// Define the rndc key for rndc command. Use "rndc-confgen -a -b 512"
// to create a new key
// --------------------------------------------------------------------
include "/etc/rndc.key";
options {
directory "/var/named";
pid-file "/var/run/named/named.pid";
statistics-file "/var/log/named/named.stats";
dump-file "/var/log/named/named.dump";
zone-statistics yes;
forwarders {
194.109.6.66;
194.109.9.99;
194.109.104.104;
};
};
zone "." {
type hint;
file "/etc/db.cache";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "/etc/127.0.0.rev";
};
zone "boudewijnector.com" {
type master;
file "/etc/boudewijnector.com.hosts";
};
zone "0.0.10.in-addr.arpa" {
type master;
file "/etc/10.0.0.rev";
};
# Use with the following in named.conf, adjusting the allow list as needed:
key "rndc-key" {
algorithm hmac-md5;
secret "WhS1vNG3buvfRS8wP+o3Vw==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
# End of named.conf
And tada: It runs
I'd like to thank everybody who's helped me a lot!
|
|
|
03-11-2005, 08:56 PM
|
#15
|
Member
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49
Rep:
|
Bind9: NDC command failed : rndc: connect failed: connection refused
I finally figured mine out.
In /etc/sysconfig/named was written:
ROOTDIR="/var/named/chroot/"
I had uninstalled the bind-chroot rpm, but didn't notice this little file until I went reading the startup file in /etc/init.d/named.
If you completely comment out that line (which left my file with NO active lines), it may start for you.
|
|
|
All times are GMT -5. The time now is 11:51 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|