LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-28-2006, 04:47 PM   #1
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Rep: Reputation: 30
Setting up bind and named


Hey, i got an emergency.

I am trying to install named. So far, i can perform the start on named, but it fails. It gives me some 'no ttl so using TAO' error message. And guess what, all .dns files in /var/named are flashing red, and when trying to more them, i get no such file error. I have read like 20 sites explaining how to set up named, but i just don't understand how to install it.

PLEASE HELP!!!!!! Really.

Ok, i copied named.conf back to /etc and the rest of files to /var/named. There's still one missing, called rndc.key. I perform the command 'service named start', and the command line just jumps to a new one, does nothing. I suppose the rndc.key is needed to start named.

Help dudes!!!!!!!!!

Last edited by trebek; 11-28-2006 at 05:09 PM.
 
Old 11-28-2006, 05:27 PM   #2
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
I think "flashing red files" usually means "missing target of a symlink", but I really don't know how it's set up on any particular OS...

Any way, why were you moving files around to begin with? There's really no way to tell you what's wrong if you don't tell us every step you took to install named in the first place.

If you had read some of the man pages, you may have noticed that rndc is the control program that interfaces with named and that you need to generate a pre-shared key that rndc will use to authenticate commands to named. On some platforms you can spit out a default configuration with:
$ rndc-confgen

If my memory serves me, you need a copy of rndc.key in both /etc and /var/named/etc, since named typically chroots itself into /var/named, thus it wouldn't be able to lookup the rndc.key from the "real" /etc after it's chrooted.
 
Old 11-28-2006, 05:40 PM   #3
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Named was already working. And i don't remember deleting nothing. I do remember moving the zone files and named.conf from another server, but that's it.

Is there a way to rebuild this rndc.key file?

I downloaded the source and performed the ./configure, make and make install commands. Modified the files accordingly to my configuration, and performed the ./named command in /usr/local/sbin as i read in the manual. But rndc.key never came back. It is still flashing, as if it was missing.
 
Old 11-28-2006, 06:23 PM   #4
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
Errr... well if you moved a named.conf from another server to this one, there's a very good chance that the directory prefix was different, or that it referenced files that don't exist on the system you just setup. Like I said before, if you have "flashing red files" that usually means they're symlinks, which are just pointers to files located somewhere else. If the files they point at were deleted, sure your symlinks might still be there in the proper directories, but they're worthless without the actual files.

If your named.conf file is referencing an rndc key you can just copy that and use it as your rndc.key file. Like I said, you need to read the man page for rndc, rndc.conf, etc. Everything is explained.
 
Old 11-28-2006, 10:11 PM   #5
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Don't know how it's working.

It could be that my machine is caching some kind of info, but it appears to work. Nonetheless, rndc.key is still missing (flashing). I restarted my machine and put the new DNS ip on 2 windows computers and my linux fedora installation. Apparently it is working. It's a good thing, but i still have to get that rndc.key file right.

I'll be sure to be posting back cause i don't think this is the end of this story, i will definitely have some more questions later. But hey chort, you seem to know your way around all these things, thanks a bunch man.
 
Old 11-30-2006, 02:17 PM   #6
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Hey chort, i need your help again man. I moved the server and now named is not starting. The same problem. How can i get my rndc.key back to where it was? I swear i didn't move any files rather than the .dns files on /var/named from the other DNS to the new one, and it's corresponding /etc/named.conf file too. rndc.key controls named, so i am f..... if i don't have it. It is still blinking.

Hey, i read about the rndc command, and i can perform a 'rndc-confgen -a'. This will create an automatic rndc.key configuration; the problem is that when i run it, i get a 'unable to create /etc/rndc.key' error message. Is this fixable??? Or should i start reinstalling linux?

Ok, here's what i've done to try and correct the problem. /etc/rndc.key was a symbolic link. It was flashing because /var/named/chroot/etc/rndc.key did not exist. So i created the directory and the file, and it stopped blinking. After that, i typed it 'rndc-confgen -a'. It did run and created a new rndc.key. So i copied over this file to /etc. I thought this would work, but named is still not starting.

Whatta you think i should do?

FORGET ALL THIS, i just reinstalled and copied files again. But here's the error i am getting when starting named:
Code:
Stopping named:                                            [FAILED]
Starting named:
Error in named configuration:
zone localhost/IN: loaded serial 42
zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
zone 210.168.192.in-addr.arpa/IN: loaded serial 1997022700
badlands.dns:5: no TTL specified; using SOA MINTTL instead
dns_master_load: badlands.dns:16: $TTL 2196900608 > MAXTTL, setting $TTL to 0
badlands.dns:17: TTL set to prior TTL (0)
zone badlands.co.cr/IN: loaded serial 17
badlandscasino.dns:6: no TTL specified; using SOA MINTTL instead
dns_master_load: badlandscasino.dns:17: $TTL 2196900608 > MAXTTL, setting $TTL to 0
badlandscasino.dns:18: TTL set to prior TTL (0)
zone badlandscasino.co.cr/IN: loaded serial 14
zone lucheafar.co.cr/IN: loading master file lucheafar.dns: file not found
_default/lucheafar.co.cr/IN: file not found
massmail.dns:5: no TTL specified; using SOA MINTTL instead
zone massmail.co.cr/IN: loaded serial 10
Where's the problem?

Last edited by trebek; 11-30-2006 at 04:52 PM.
 
Old 11-30-2006, 06:56 PM   #7
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
There's nothing in those warnings that would indicate why named isn't starting, but your zone files are a mess! You have really weird TTLs, and your serial numbers don't follow the YYYYmmddnn format (not required, but highly suggested). Also, the zone file for lucheafar.co.cr is missing. Are there any other named-related warnings/errors in /var/log/messages or /var/log/syslog?

Do you have the same rndc.key in /etc and /var/named/chroot/etc? If there's a symlink in /etc then all you need to do is put the right file in /var/named/chroot/etc. From your description it sounds like you might have overwritten the symlink in /etc with the output of rndc-confgen -a as a file. Either copy the file to both locations, or leave the symlink in /etc alone (make sure it really is a symlink) and just put the file in /var/named/chroot/etc. Also you need to make sure there's a matching section in /var/named/chroot/etc/named.conf (or wherever your named.conf is).

This is the bit you need to have in named.conf (make sure to use the same key as your rndc.key, do not copy this one):
Code:
# Use with the following in named.conf, adjusting the allow list as needed:
key "rndc-key" {
      algorithm hmac-md5;
      secret "iAombR2E4Dt6azvWihnruw==";
};

controls {
      inet 127.0.0.1 port 953
              allow { 127.0.0.1; } keys { "rndc-key"; };
};
Remember: If named is chroot'ing itself, the zone files need to be inside the chroot area. You should carefully review your named.conf to make sure the path to each file is correct for being inside the chroot'ed directory.

Last edited by chort; 11-30-2006 at 06:58 PM.
 
Old 12-04-2006, 02:15 PM   #8
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Original Poster
Rep: Reputation: 30
Ok, i managed to fix it up a little bit. /etc/named.conf and the zone files in /var/named (*.dns files). Now, the server keeps working for a couple of days, and then, all of a sudden, it stops resolving. I don't have syslog in /var/log, but messages does not tell me what's going on. I'll check the logs again just in case and post them here.

Ok, here's what happens. It is happening right now. Somehow, it works internally, but stops resolving for addresses outside. When using nslookup, internally, it shows the correct address for every single site that we have, but when going to addresses outside, it works like 10% of the times, and most of the times i get this error: ';; connection timed out; no servers could be reached'. /var/log/messages is not gathering any information about the current stop or slow down of named. Where is it putting the log messages?

Another thing i just did to verify what i just explained. I put two DNS entries on my network config, and internally, everything resolves to the new server, but when going outside, it resolves with the old server. I restarted the new server, and it is fixed, for the moment of course. I guess some service stops working that's required by named to work outside. I really don't know what's happening.

I got these lines on /var/log/messages, perhaps it'll clear up what's going on:
Code:
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { getpwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { shmempwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { getpwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { shmempwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 last message repeated 2 times
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { getpwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 last message repeated 2 times
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { shmempwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { getpwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { shmempwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { shmempwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { getpwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { getpwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { shmempwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { getpwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd 
Dec  4 15:25:39 penguin2 nscd: Can't send to audit system: USER_AVC pid=24171 uid=28 loginuid=-1 message=avc:  denied  { shmempwd } for  scontext=system_u:system_r:udev_t tcontext=root:system_r:initrc_t tclass=nscd
So, the real question is: why is the new server not forwarding or responding when looking for things outside? Is is so hard to set up named to work? Or is it just me?

Last edited by trebek; 12-04-2006 at 03:59 PM.
 
  


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
BIND -named.conf ryanc75 Linux - General 3 09-19-2005 02:57 AM
BIND not loading named.ca Flawless Linux - Newbie 1 12-17-2004 11:29 AM
bind and named Red Squirrel Linux - Software 3 04-25-2004 09:49 PM
BIND / named r3ekon Linux - Newbie 6 10-16-2003 05:33 PM
Bind / named 80s Linux - Networking 3 03-20-2003 07:47 AM

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

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