LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 07-07-2012, 09:13 AM   #1
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 65

Rep: Reputation: 21
interesting named isue again, cant write log files.....and a weard rndc thing


finaly named working (YEAH, than everyone)
but i got 2 questions.

1]
I start looking around, and saw, where is my named.log (or whatever it should be atm)

so, i made a nice logging entry in named.conf.

Code:
logging {
//
    channel named_log {
    file "/var/log/named/named.log" versions 3 size 5m;
    severity info;
    print-severity yes;
    print-time yes;
    print-category yes;
    };
    category default {
    named_log;
    };
    };
also entered rndc stuff
took me a while ,but it works, i can start stop named.
made in options this entry
Code:
    dump-file "/var/log/named/named.dump";
    statistics-file "/var/log/named/named.stats";
    zone-statistics yes;
so, looks nice.

rndc stuff
Code:
controls {
    inet 127.0.0.1 allow { localhost; }
    keys { <my key name>; };
    };

key "<my key name>" {
    algorithm hmac-md5;
    secret "<sssssh xD>";
    };
how ever,after manual stopping named.
en started over rndc start, all starts up.
but.

no log files!!!

/var/log/named has 644 named named as owner stuff
did a touch in it for named.log named.dump named.stats
right set as 644 named named

did a rndc reconfig
didnt got a error (good xD)
but, log files where unchanged ,still 0 bytes.

so, i tought, lets do rndc stats.
rndc: 'stats' failed: file not found

umh, file is correct, so wtf ?
so, i tried rndc reconfig /var/named/etc/named.conf
and in messages gave me this output.
isc_log_open `var/log/named/named.log ` failed: file not found.

so, now i am confussed...
can some1 tell me the correct read/write permissions for directory and files.


now my 2nd question
i guess this is more interesting.

2]
rndc is a control server as far i understood.
so my question..
named is setup do serve local dns stuff for my lan machines. (www/ftp/mail/dns)

as far i can see, works as a charm.
but what i want to know, can rndc write back the dns stuff it has in memory to a file, and reload it when need to boot named the hard way, or after a machine reboot.

if yes, how do i handle this ???
personaly, i think..

named.conf (example entry)
Code:
// Whatever zones
    zone "saved.zones" {
    type master;
    file "/master/saved.zones";
    allow-transfer { clients;};
    allow-query { any; };
    };
where saved.zones the dns stuff in memory is, and readed again when named comes back again.
so that i wount need to fetch all the stuff again.

thnxs..

Last edited by spatieman; 07-07-2012 at 09:17 AM.
 
Old 07-07-2012, 11:27 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Hi,

1.
Quote:
can some1 tell me the correct read/write permissions for directory and files.
Check if you're running named chrooted under some directory (usually /var/named).
If that's the case, then the log files you look for (as well as the stats and dump files) are located under /var/named/var/log/named
The directory should be owned by the user:group named run as. If they don't exist, they should be created so you don't need to touch them.

2.
Quote:
but what i want to know, can rndc write back the dns stuff it has in memory to a file, and reload it when need to boot named the hard way, or after a machine reboot.
rndc can dump the cache in a file (using rndc dump), but you cannot reload the cache in memory from that file.

Regards
 
Old 07-07-2012, 12:41 PM   #3
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 65

Original Poster
Rep: Reputation: 21
on 1]
when removing log section, rndc makes file in var/named/tmp
when removing // and editoring paths to /var/named/var/log/named/ and editing rights, same error.
saying could not open dumb files ///// file not found.
dunno how to chech if named is chrooted...

2]
bummer..
i readed somewhere that it was posible with slave option, but we see, loggins goes 1st.

--edit-
thought i was smart xD
changed all log directives to /var/named/tmp
but, still error.

Last edited by spatieman; 07-07-2012 at 12:52 PM.
 
Old 07-07-2012, 01:24 PM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Run
Code:
ps -ef|grep named
and see if there is a -t option. The path after -t is the jail directory
 
Old 07-07-2012, 04:32 PM   #5
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 65

Original Poster
Rep: Reputation: 21
hmm..
# ps -ef | grep named
ps: unknown option -- f
usage: ps [-aCcehjkLlmrSTuvwx] [-M core] [-N system] [-O fmt] [-o fmt] [-p pid]
[-t tty] [-U username] [-W swap]
#

but a ps aux gives this
# ps aux | grep named
named 11993 0.0 3.0 14424 15532 ?? S 7:40PM 0:02.98 /usr/sbin/named
root 25421 0.0 0.2 1996 988 ?? Is 7:40PM 0:00.01 named: [priv] (named)
#

guess openBSD cant do -ef
 
Old 07-07-2012, 06:16 PM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Quote:
guess openBSD cant do -ef
I guess so too...
Anyway, looks like you're running named not chrooted, which is strange, as bind in openbsd is chrooted by default. Also there is no "-u named" in the ps output
You better have a look at this howto to see how to configure bind correctly.

Regards
 
Old 07-08-2012, 05:48 AM   #7
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 65

Original Poster
Rep: Reputation: 21
bind is running as sharmed..
but the logging is the only i NEVER could get working..
 
Old 07-08-2012, 07:05 AM   #8
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 65

Original Poster
Rep: Reputation: 21
looks like the way i did the setup..
 
Old 07-08-2012, 02:47 PM   #9
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Quote:
Originally Posted by spatieman View Post
bind is running as sharmed..
but the logging is the only i NEVER could get working..
Doh, you can use lsof or fstat to see what files are opened by named, so you could locate the log file.
 
Old 07-09-2012, 05:32 AM   #10
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 65

Original Poster
Rep: Reputation: 21
fstat | named
dont see log files.
 
Old 07-09-2012, 01:00 PM   #11
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Quote:
Originally Posted by spatieman View Post
fstat | named
dont see log files.
You should use
Code:
fstat | grep named
 
Old 07-10-2012, 06:03 AM   #12
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 65

Original Poster
Rep: Reputation: 21
typo my friend, i ment | grep named xD
wasquit late at that time.
 
Old 07-10-2012, 09:10 AM   #13
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
What's the "directory" option in named.conf?
You can just specify filenames for the log file (stats and dumb filenames are by default named.stats and named_dump.db, so you can omit them completely) and see it they are created and the directory configured above.
 
Old 07-12-2012, 09:46 AM   #14
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 65

Original Poster
Rep: Reputation: 21
directory option give a error in messages.
 
Old 07-12-2012, 11:59 AM   #15
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Quote:
Originally Posted by spatieman View Post
directory option give a error in messages.
Try to be more informative next time...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] weard named output on zonecheck.... spatieman *BSD 6 06-30-2012 07:40 AM
openBSD alt-Q weard isue. spatieman *BSD 0 01-05-2010 10:40 AM
openBSD 4.4 dhcpd.conf, weard thing ? spatieman *BSD 2 01-05-2010 10:25 AM
Where are the log files of named? Niceman2005 Linux - Software 3 12-14-2005 07:20 PM
named without rndc spank Linux - Newbie 0 12-16-2003 09:52 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration