LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (http://www.linuxquestions.org/questions/%2Absd-17/)
-   -   interesting named isue again, cant write log files.....and a weard rndc thing (http://www.linuxquestions.org/questions/%2Absd-17/interesting-named-isue-again-cant-write-log-files-and-a-weard-rndc-thing-4175415395/)

spatieman 07-07-2012 09:13 AM

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..

bathory 07-07-2012 11:27 AM

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

spatieman 07-07-2012 12:41 PM

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.

bathory 07-07-2012 01:24 PM

Run
Code:

ps -ef|grep named
and see if there is a -t option. The path after -t is the jail directory

spatieman 07-07-2012 04:32 PM

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

bathory 07-07-2012 06:16 PM

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

spatieman 07-08-2012 05:48 AM

bind is running as sharmed..
but the logging is the only i NEVER could get working..

spatieman 07-08-2012 07:05 AM

looks like the way i did the setup..

bathory 07-08-2012 02:47 PM

Quote:

Originally Posted by spatieman (Post 4722052)
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.

spatieman 07-09-2012 05:32 AM

fstat | named
dont see log files.

bathory 07-09-2012 01:00 PM

Quote:

Originally Posted by spatieman (Post 4722774)
fstat | named
dont see log files.

You should use
Code:

fstat | grep named

spatieman 07-10-2012 06:03 AM

typo my friend, i ment | grep named xD
wasquit late at that time.

bathory 07-10-2012 09:10 AM

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.

spatieman 07-12-2012 09:46 AM

directory option give a error in messages.

bathory 07-12-2012 11:59 AM

Quote:

Originally Posted by spatieman (Post 4726040)
directory option give a error in messages.

Try to be more informative next time...


All times are GMT -5. The time now is 03:42 PM.