LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-14-2004, 06:47 PM   #1
Boudewijn
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: Reputation: 30
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";
};
 
Old 09-15-2004, 03:55 AM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
"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.
 
Old 09-15-2004, 04:05 AM   #3
Boudewijn
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: Reputation: 30
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";
};
 
Old 09-15-2004, 04:22 AM   #4
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
the following may help u.
http://www.linuxquestions.org/questi...hreadid=229950

good luck
 
Old 09-15-2004, 04:29 AM   #5
Boudewijn
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: Reputation: 30
Thanks, I'll ahve look in the afternoon
 
Old 09-15-2004, 07:42 AM   #6
Boudewijn
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: Reputation: 30
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?
 
Old 09-15-2004, 08:01 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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.
 
Old 09-15-2004, 08:30 AM   #8
Boudewijn
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: Reputation: 30
I've already chown'ed it to 'named'
 
Old 09-15-2004, 08:49 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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.
 
Old 09-15-2004, 08:55 AM   #10
Boudewijn
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: Reputation: 30
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]#
 
Old 09-15-2004, 09:03 AM   #11
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
Boudewijn

did u try "rndc-confgen" ?
 
Old 09-15-2004, 09:07 AM   #12
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Then chmod 777 /var/named
 
Old 09-15-2004, 09:13 AM   #13
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
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.
 
Old 09-15-2004, 12:54 PM   #14
Boudewijn
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: Reputation: 30
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!
 
Old 03-11-2005, 08:56 PM   #15
Cerephim
Member
 
Registered: Mar 2005
Location: Dayton, Ohio
Distribution: CentOS
Posts: 49

Rep: Reputation: 0
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.
 
  


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
DNS problem rndc: connect failed connection refused error suchi Linux - Networking 14 05-27-2007 11:51 AM
rndc: connect failed: connection refused jkmartha Linux - Software 0 06-20-2005 01:35 AM
DNS Problem - rndc: connect failed: connection refused krishvij Linux - Newbie 2 04-25-2005 07:40 AM
rndc: connect failed: connection refused Justalk Linux - Software 2 06-28-2004 03:45 PM
rndc: connect failed: connection refused Atroxic Linux - Networking 1 10-24-2003 01:01 PM

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

All times are GMT -5. The time now is 03:57 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