| Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-12-2007, 01:41 AM
|
#1
|
|
Member
Registered: Feb 2007
Posts: 126
Rep:
|
DNs log files
hi to All,
I am using RHEL-5 Linux where I have configured master and slave DNS servers.
To check dns zone transfer and any kind of bind error , we use /var/log/messages file. How can I create seperate DNS log file , say /var/log/bindlog so that all DNS errors and info should be logged in such a file.
Can anybody tell me how to configure named.conf to log all bind events in /var/log/bindlog file ?
logging {
channel bindlog {
print-name yes;
print-category yes;
print-severity yes;
}
categorty xfer-out { bindlog;};
categorty xfer-in { bindlog;};
categorty security { bindlog;};
categorty panic { bindlog;};
categorty insist { bindlog;};
};
I have added these parameters in named.conf file , restarted all services but even then no logging inabove file.
Why
Last edited by sachin1361; 09-12-2007 at 01:58 AM.
|
|
|
|
09-12-2007, 02:58 AM
|
#2
|
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
|
Hi again.
You should make some changes in your logging part of named.conf. First of all you should define a log filename. Then some categories do not exist (I guess categorty is just a typo). Anyway you can try this:
Code:
logging {
channel bindlog {
file "/var/named/named.log" versions 3 size 5m;
print-time yes;
print-category yes;
print-severity yes;
};
category xfer-out { bindlog;};
category xfer-in { bindlog;};
category security { bindlog;};
};
In the above example make sure that the directory used for the logfile is writable by the user that runs named.
You can read more about bind logging here
|
|
|
|
09-13-2007, 02:33 AM
|
#3
|
|
Member
Registered: Feb 2007
Posts: 126
Original Poster
Rep:
|
log file
I did mention log file location but forgot to add into forum. I am sorry fot that.
The docs you provided was very helpful.But problem is same.No events are logged in the bindlog file. As per the docs, named users mush have write access to log file, it is already assigned.
What else may be the problem ?
|
|
|
|
09-13-2007, 02:51 AM
|
#4
|
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
|
Could you just copy/paste the above snippet into your named.conf, just after the options part and before the start of zone definitions (after making a backup first) to see what happens.
|
|
|
|
09-15-2007, 01:49 AM
|
#5
|
|
Member
Registered: Feb 2007
Posts: 126
Original Poster
Rep:
|
dns log file
this is the named.conf file snapshot. DNS master and slave is working fine.No problem at all. But events are not logged in the named.log file.
Please check it.
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
/*
*/
// query-source address * port 53;
allow-recursion { 172.16.1.0/24; 172.16.2.0/24; localhost; };
allow-transfer { 172.16.2.6; };
allow-query { 172.16.1.0/24; 172.16.2.0/24; localhost; };
version "[Secured]";
};
zone "." IN {
type hint;
file "named.root";
};
zone "localdomain." IN {
type master;
file "localdomain.zone";
allow-update { none; };
}
;
zone "localhost." IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa." IN {
type master;
file "named.local";
allow-update { none; };
notify no;
};
zone "8i.net.sa" IN {
type master;
file "8i.net.sa.zone";
allow-update { none; };
allow-transfer { 172.16.2.6; };
notify yes;
allow-query { any; };
};
zone "2.16.172.in-addr.arpa." IN {
type master;
file "8i.net.sa.local";
allow-update { none; };
allow-transfer { 172.16.2.6; };
notify yes;
allow-query { any; };
};
zone "255.in-addr.arpa." IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa." IN {
type master;
file "named.zero";
allow-update { none; };
};
# Use with the following in named.conf, adjusting the allow list as needed:
key "rndckey" {
algorithm hmac-md5;
secret "hM3UJdk9eAL+8pK56X0gng==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
};
# End of named.conf
server 172.16.2.6 {
keys { rndckey ;};
};
logging {
channel sachin_debug {
file "/var/log/named.log" versions 3 size 5m;
print-category yes;
severity info;
print-severity yes;
print-time yes;
};
category config {
sachin_debug;
};
category xfer-in {
sachin_debug;
};
category xfer-out {
sachin_debug;
};
category queries {
sachin_debug;
};
};
|
|
|
|
09-15-2007, 08:36 AM
|
#6
|
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
|
Are you sure that the user that runs named can write to /var/log/named.log?
I suggest you to change the location of that file to be inside the /var/named directory, just to be sure that the named-user has write permissions. So change the following:
logging {
channel sachin_debug {
file "/var/named/named.log" versions 3 size 5m;
...
...
restart named and check /var/named/named.log
|
|
|
|
09-16-2007, 01:58 AM
|
#7
|
|
Member
Registered: Feb 2007
Posts: 126
Original Poster
Rep:
|
dns log file
Thanx for replying,
I did the same as you told me to do . But still ,problem not resolved.I changed the named.log file location and assure that named user has write permission access on that file , restarted the named dameon,But named.log fie has no events.
But when i checked tail /var/log/messages file, there was one error :
localhost named [5444]: isc_log_open '/var/named/named.log' failed  ermission denied
Why is it so ?
I think the same as you told permission error.But I had assigned full permission by:
# chmod 777 /var/named/named.log
so why this error??
What should I do next ?
Last edited by sachin1361; 09-16-2007 at 02:21 AM.
|
|
|
|
09-16-2007, 09:18 AM
|
#8
|
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
|
You should double check the directories/files permissions, or post the output of:
Code:
ls -l /var
ls -l /var/named
ps -ef|grep named
Another think you should check, is that it's not a SeLinux issue or that named is running chrooted.
|
|
|
|
09-17-2007, 02:08 AM
|
#9
|
|
Member
Registered: Feb 2007
Posts: 126
Original Poster
Rep:
|
dns log file
This is the output of commands you required. Anyhow I assign the permissions and change the ownership to named user, now there is no such error as permission denied.but still no logging in the named.log file.
What else should I do now ?
NO PERMISSION DENIED ERROR NOW, BUT STILL NO LOGGING
[root@test4 ~]# ls -l /var
total 220
drwxr-xr-x 2 root root 4096 Sep 9 11:18 account
drwxr-xr-x 2 pcap pcap 4096 Sep 12 15:18 arpwatch
drwxr-xr-x 13 root root 4096 Sep 9 11:36 cache
drwxr-xr-x 2 root root 4096 Jan 24 2007 crash
drwxr-xr-x 2 root root 4096 Dec 7 2006 cvs
drwxr-xr-x 3 root root 4096 Sep 9 11:19 db
drwxr-xr-x 3 root root 4096 Sep 9 11:18 empty
drwxr-xr-x 3 root root 4096 Sep 9 11:23 ftp
drwxr-xr-x 2 root root 4096 Oct 11 2006 games
drwxrwx--T 2 root gdm 4096 Sep 17 10:00 gdm
drwxr-xr-x 3 root root 4096 Sep 9 11:29 kerberos
drwxr-xr-x 44 root root 4096 Sep 12 12:13 lib
drwxr-xr-x 2 root root 4096 Oct 11 2006 local
drwxrwxr-x 10 root lock 4096 Sep 17 09:42 lock
drwxr-xr-x 26 root root 4096 Sep 17 09:42 log
lrwxrwxrwx 1 root root 10 Sep 9 11:15 mail -> spool/mail
drwxrwxrwx 5 named named 4096 Sep 16 14:53 named
drwx------ 2 root root 4096 Sep 17 09:42 net-snmp
drwxr-xr-x 2 root root 4096 Oct 11 2006 nis
drwxr-xr-x 2 root root 4096 Oct 11 2006 opt
drwxr-xr-x 2 root root 4096 Oct 11 2006 preserve
drwxr-xr-x 2 root root 4096 Oct 1 2006 racoon
drwxr-xr-x 33 root root 4096 Sep 17 09:42 run
drwxr-xr-x 24 root root 4096 Sep 9 11:29 spool
drwxrwxrwt 3 root root 4096 Sep 12 12:47 tmp
drwx------ 2 root root 4096 Aug 23 2006 tux
drwx------ 2 root bin 4096 Sep 12 12:50 webmin
drwxr-xr-x 9 root root 4096 Sep 9 11:28 www
drwxr-xr-x 3 root root 4096 Sep 9 11:28 yp
[root@test4 ~]#
[root@test4 ~]# ls -l /var/named
total 28
drwxr-x--- 6 named named 4096 Sep 10 12:14 chroot
drwxrwx--- 2 named named 4096 Sep 16 14:53 data
-rwxrwxrwx+ 1 named named 0 Sep 16 09:41 named.log
drwxrwx--- 2 named named 4096 Jan 17 2007 slaves
[root@test4 ~]#
[root@test4 ~]# ps -ef |grep named
named 2233 1 0 09:42 ? 00:00:00 /usr/sbin/named -u named -t /var/named/chroot
root 5176 5013 0 10:02 pts/4 00:00:00 grep named
[root@test4 ~]#
|
|
|
|
09-17-2007, 02:44 AM
|
#10
|
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
|
Quote:
[root@test4 ~]# ps -ef |grep named
named 2233 1 0 09:42 ? 00:00:00 /usr/sbin/named -u named -t /var/named/chroot
|
So you running named chrooted.
In that case all your logs should be under /var/named/chroot/var/named/named.log
|
|
|
|
09-18-2007, 01:56 AM
|
#11
|
|
Member
Registered: Feb 2007
Posts: 126
Original Poster
Rep:
|
dns log files
I found the log files in this location. But why is this so ? Means when i specify the exact location of log file in named.conf file, then why log files are created in this lcoation ? And what does it means when named is running under chroot environement as you said .OR it means when named services are running chroot jail, log files will only be created in this location as you mentioned?
If i have to created log files in different location as earlier, say /var/log/named.log, then what shall I have to do ?
Many thanks for resolving this query. I was stucked in this problem frm last one week.
|
|
|
|
All times are GMT -5. The time now is 05:17 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|