LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DNS service error questions (https://www.linuxquestions.org/questions/linux-networking-3/dns-service-error-questions-233679/)

emailssent 09-22-2004 01:17 AM

DNS service error questions
 
i am totally new to dns and learning it through tldp.org docs.

when i restart nameed service it says
Stopping named: [FAILED]
Starting named: [ OK ]

i have rndc.conf file , but i couldn't have rndc service
when i try rndc start it says connection refused.

for reference
#/etc/named.conf

options {
directory "/var/named";

// Uncommenting this might help if you have to go through a
// firewall and things are not working out. But you probably
// need to talk to your firewall admin.

// query-source port 53;
};


key "rndc-key" {
algorithm hmac-md5;
secret "+3QI4eySOTZVn4zgC9k4Tg==";
};

controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};

zone "." {
type hint;
file "root.hints";
};

zone "0.0.127.in-addr.arpa" {
type master;

file "named/127.0.0";
};



More files can be provided on demand


-jack

imezsons 09-22-2004 01:46 AM

hi

i think your /etc/named.conf file is incomplete.can u update with the zone name which u want to create and with the complete named.conf configuration.

regards
lenin

chort 09-22-2004 03:25 AM

That looks pretty close to the correct config for a caching-only DNS server. I don't see the allow recursion option, though.

The fastest way to configure rndc correctly is to remove /etc/rndc.conf and comment out the rndc key lines in /etc/named.conf, then run rndc-confgen -a, which should create all the appropriate entries. You should only have to shutdown and restart named from there.

emailssent 09-22-2004 04:28 AM

thanx chort for your response,

I am totally newbie to dns and i am learning from here

http://tldp.org/HOWTO/DNS-HOWTO-3.html

so , please tell newbie how to configure allow recursive option,

i had already regenrated the rndc key with rndc-confgen command placed it in rndc.conf and named.conf file.


but as u told to remove the rndc.conf file and regenerate with rndc-confgen -a , i done that but still named could not be start.


for reference
#tail -f 10 /var/log/messages
Sep 22 15:39:25 mandrake named[2944]: using 1 CPU
Sep 22 15:39:25 mandrake named[2946]: loading configuration from '/etc/named.conf'
Sep 22 15:39:25 mandrake named: named startup succeeded
Sep 22 15:39:25 mandrake named[2946]: no IPv6 interfaces found
Sep 22 15:39:25 mandrake named[2946]: listening on IPv4 interface lo, 127.0.0.1#53
Sep 22 15:39:25 mandrake named[2946]: listening on IPv4 interface eth0, 192.168.1.2#53
Sep 22 15:39:25 mandrake named[2946]: command channel listening on 127.0.0.1#953
Sep 22 15:39:25 mandrake named[2946]: couldn't open pid file '/var/run/named.pid': Permission denied
Sep 22 15:39:25 mandrake named[2946]: exiting (due to early fatal error)
Sep 22 15:39:28 mandrake named: named shutdown failed



-jack

rioguia 09-22-2004 07:21 AM

service named restart
 
what command are you using to restart named? this sounds like a script error in "/etc/rc.d/init.d/named". in redhat, you could get this message if you are are running "/usr/sbin/./named" directly. open a terminal, make sure you are the root user, and type service named restart.

scowles 09-22-2004 07:23 AM

Sep 22 15:39:25 mandrake named[2946]: couldn't open pid file '/var/run/named.pid': Permission denied

You must be starting named with the -u parameter. If so, you will need to create a directory that is owned by the user specifed by the -u parameter (usually named) along with the appropiate changes in named.conf. For reference, this is what I use

Code:

// ----------------------------------------------------------------
// Specify any "global" options for named
// ----------------------------------------------------------------
options {
        // If named will be started with the -u parameter,
        // make sure the following directories are owned by
        // that user. i.e. named
        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;

Note where the pid-file is pointing to.
Finally, the corresponding directory structure/ownership for the above.
Code:

[root@voyager log]# cd /var/run
[root@voyager run]# ls -ld named
drwxrwx---    2 named    named        4096 Oct 17  2003 named
[root@voyager run]# cd /var/log
[root@voyager log]# ls -ld named
drwxrwx---    2 named    named        4096 Sep 22 07:13 named


emailssent 09-24-2004 01:16 AM

thanks rioguia && scowles

@rioguia
Quote:

what command are you using to restart named? this sounds like a script error in "/etc/rc.d/init.d/named". in redhat, you could get this message if you are are running "/usr/sbin/./named" directly. open a terminal, make sure you are the root user, and type service named restart.
i am using this command,

# /etc/init.d/named restart
Stopping named: [FAILED]
Starting named: [ OK ]
but when i did this same error,

# service named restart
Stopping named: [FAILED]
Starting named: [ OK ]


@scowles
could u plz tell me specific command to start named using 'u' switch.

bathory 09-24-2004 03:03 AM

Just kill it' pid and start it again. I've never managed to make named restart. It only starts a new process

emailssent 09-24-2004 05:31 AM

there is no such process running when i checked with ps x|grep named

any other idea ??

bathory 09-24-2004 05:46 AM

Check with ps aux|grep named (as it ususally run as user named)
named is started with:
Code:

/path/to/named -u named

emailssent 09-24-2004 05:56 AM

$ ps aux|grep named
emailssent 2865 0.0 0.5 1828 604 pts/1 R 16:34 0:00 grep named

$ kill -9 2865
bash: kill: (2865) - No such process

$ ps aux|grep named
emailssent 2869 0.0 0.5 1828 604 pts/1 R 16:34 0:00 grep named

$ kill -9 2869
bash: kill: (2869) - No such process

$ ps aux|grep named
emailssent 2871 0.0 0.5 1828 604 pts/1 R 16:34 0:00 grep named

bathory 09-24-2004 06:10 AM

So named is not running. Check your /var/log/messages to find out why it does not start.

emailssent 09-24-2004 06:14 AM

Sep 24 16:55:28 mandrake named[2943]: starting BIND 9.2.3rc2 -u named
Sep 24 16:55:28 mandrake named[2943]: using 1 CPU
Sep 24 16:55:28 mandrake named: named startup succeeded
Sep 24 16:55:28 mandrake named[2951]: loading configuration from '/etc/named.conf'
Sep 24 16:55:28 mandrake named[2951]: no IPv6 interfaces found
Sep 24 16:55:28 mandrake named[2951]: listening on IPv4 interface lo, 127.0.0.1#53
Sep 24 16:55:28 mandrake named[2951]: listening on IPv4 interface eth0, 192.168.1.2#53
Sep 24 16:55:28 mandrake named[2951]: command channel listening on 127.0.0.1#953
Sep 24 16:55:28 mandrake named[2951]: couldn't open pid file '/var/run/named.pid': Permission denied
Sep 24 16:55:28 mandrake named[2951]: exiting (due to early fatal error)

scowles 09-24-2004 06:31 AM

couldn't open pid file '/var/run/named.pid': Permission denied

You're named.conf file is still referencing the option
pid-file "/var/run/named.pid" instead of /var/run/named/named.pid.

See post #6 of this thread.

bathory 09-24-2004 06:36 AM

You have wrong permissions in /var/run where named tries to write it's pid. So do as scowles suggested, i.e create the directory named under /var/run, then:
Code:

chown -R named:named /var/run/named
add the line:
Code:

pid-file "/var/run/named/named.pid";
in /etc/named.conf and try again


All times are GMT -5. The time now is 10:10 AM.