PDA

View Full Version : rndc connect failed: connection refused



jkmartha
20th June 2005, 07:28 AM
distro - fedora -2
problem with DNS. details are as follows.........................


[root@sarayu root]# cat /var/named/chroot/etc/named.conf
// generated by named-bootconf.pl

options {
directory "/var/named";
/*
* 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;
forwarders {61.1.96.69;};
forward only;
};

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

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};

zone "sarayu.com" IN {
type master;
file "sarayu.com.zone";
// allow-update { none; };
};

zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.in-addr.arpa.zone";
// allow-update { none; };
};

include "/etc/rndc.key";


-------------------------------------------------------
[root@sarayu root]# cat /var/named/sarayu.com.zone
$TTL 86400
$ORIGIN sarayu.com.
@ 1D IN SOA @ root.sarayu.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

1D IN NS sarayu.com.
1D IN A 192.168.1.5
-----------------------------------------------------------------
[root@sarayu root]# cat /var/named/1.168.192.in-addr.arpa.zone
$TTL 86400
@ IN SOA sarayu.com. root.sarayu.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS sarayu.com.

5 IN PTR sarayu.com.




--------------------------------------------------
[root@sarayu root]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.5 sarayu.com sarayu.com


---------------------------------------------------------
now, when i use the follwoing command,
[root@sarayu root]# service named status
rndc: connect failed: connection refused

[root@sarayu root]# rndc status
rndc: connect failed: connection refused

What may b the problem ?

brianmsu80
20th June 2005, 07:38 AM
I had similar problem.
First check your
tail -f /var/log/messages
But I am guessing it's a permissions problem.

Try
chmod 755 /var/run/named
chmod 750 /var/named
and then starting again.

Also make sure /etc/rndc.key exists.
named.pid doesnt need to exist but the permissions of /var/run/named/ need to be correct.

jkmartha
20th June 2005, 07:40 AM
[root@sarayu root]# grep 'named' /var/log/messages | tail -n 20
Jun 20 06:14:30 sarayu named[3644]: running
Jun 20 11:44:30 sarayu named: named startup succeeded
Jun 20 06:31:43 sarayu named[3644]: shutting down
Jun 20 06:31:43 sarayu named[3644]: no longer listening on 127.0.0.1#53
Jun 20 06:31:43 sarayu named[3644]: no longer listening on 192.168.1.5#53
Jun 20 06:31:43 sarayu named[3644]: exiting
Jun 20 12:01:43 sarayu named: named shutdown succeeded
Jun 20 06:31:45 sarayu named[4087]: starting BIND 9.2.3 -u named -t /var/named/chroot
Jun 20 06:31:45 sarayu named[4087]: using 1 CPU
Jun 20 06:31:45 sarayu named[4087]: loading configuration from '/etc/named.conf'
Jun 20 06:31:45 sarayu named[4087]: listening on IPv4 interface lo, 127.0.0.1#53
Jun 20 06:31:45 sarayu named[4087]: listening on IPv4 interface eth0, 192.168.1.5#53
Jun 20 06:31:45 sarayu named[4087]: /etc/named.conf:21: couldn't install keys for command channel 127.0.0.1#953: not found
Jun 20 06:31:45 sarayu named[4087]: /etc/named.conf:21: couldn't add command channel 127.0.0.1#953: not found
Jun 20 06:31:45 sarayu named[4087]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Jun 20 06:31:45 sarayu named[4087]: zone 1.168.192.in-addr.arpa/IN: loading master file 1.168.192.in-addr.arpa.zone: file not found
Jun 20 06:31:45 sarayu named[4087]: zone sarayu.com/IN: loading master file sarayu.com.zone: file not found
Jun 20 06:31:45 sarayu named[4087]: zone localhost/IN: loaded serial 42
Jun 20 06:31:45 sarayu named[4087]: running
Jun 20 12:01:46 sarayu named: named startup succeeded

brianmsu80
20th June 2005, 07:48 AM
Does /etc/rndc.key exist?

Do you get the same error when
rndc status

Please post your /etc/rndc.conf.
Should look something like this:

options {
default-server 127.0.0.1;
default-key "rndckey";
};

server 127.0.0.1 {
key "rndckey";
};

include "/etc/rndc.key";

jkmartha
20th June 2005, 08:41 AM
/etc/rndc.key exist.

i get the same error when ......."rndc status".


# cat /etc/rndc.conf


/*
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/* $Id: rndc.conf,v 1.7 2001/01/09 21:40:45 bwelling Exp $ */

/*
* Sample rndc configuration file.
*/

options {
default-server localhost;
default-key "rndckey";
};

server localhost {
key "rndckey";
};

include "/etc/rndc.key";

brianmsu80
21st June 2005, 02:07 AM
Try changing your "localhost" to "127.0.0.1" as below.


options {
default-server 127.0.0.1;
default-key "rndckey";
};

server 127.0.0.1 {
key "rndckey";
};

include "/etc/rndc.key";