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-22-2004, 01:17 AM   #1
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Rep: Reputation: 30
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
 
Old 09-22-2004, 01:46 AM   #2
imezsons
LQ Newbie
 
Registered: Sep 2004
Location: india
Posts: 14

Rep: Reputation: 0
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
 
Old 09-22-2004, 03:25 AM   #3
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
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.
 
Old 09-22-2004, 04:28 AM   #4
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Original Poster
Rep: Reputation: 30
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

Last edited by emailssent; 09-22-2004 at 05:06 AM.
 
Old 09-22-2004, 07:21 AM   #5
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Rep: Reputation: 30
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.
 
Old 09-22-2004, 07:23 AM   #6
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
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
 
Old 09-24-2004, 01:16 AM   #7
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Original Poster
Rep: Reputation: 30
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.
 
Old 09-24-2004, 03:03 AM   #8
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
Just kill it' pid and start it again. I've never managed to make named restart. It only starts a new process
 
Old 09-24-2004, 05:31 AM   #9
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Original Poster
Rep: Reputation: 30
there is no such process running when i checked with ps x|grep named

any other idea ??
 
Old 09-24-2004, 05:46 AM   #10
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
Check with ps aux|grep named (as it ususally run as user named)
named is started with:
Code:
/path/to/named -u named

Last edited by bathory; 09-24-2004 at 05:49 AM.
 
Old 09-24-2004, 05:56 AM   #11
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Original Poster
Rep: Reputation: 30
$ 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
 
Old 09-24-2004, 06:10 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
So named is not running. Check your /var/log/messages to find out why it does not start.
 
Old 09-24-2004, 06:14 AM   #13
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Original Poster
Rep: Reputation: 30
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)
 
Old 09-24-2004, 06:31 AM   #14
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
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.
 
Old 09-24-2004, 06:36 AM   #15
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 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
 
  


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 service error LinuxRam Linux - Networking 4 09-12-2004 05:26 AM
Dns Service praveenv Linux - Newbie 2 09-08-2004 12:24 PM
Dynamic Ip Dns Service murphyyoung Linux - Networking 2 06-19-2004 02:34 PM
DNS ERROR: Name or service not known. rioguia Linux - Networking 25 10-21-2003 09:46 AM
DNS Service ddepuemd Linux - Networking 1 05-16-2002 11:17 AM

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

All times are GMT -5. The time now is 09:41 PM.

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