LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-15-2016, 10:53 AM   #1
Ganesh-vrc
LQ Newbie
 
Registered: Aug 2016
Posts: 6

Rep: Reputation: Disabled
Lightbulb Problem with DNS logging channel


Please Help..!

I have configured my DNS server with but still log is writing to /var/log/message file.


options {

// Default zone file directory for this dns server
directory "/var/named";

// Who can perform queries against this dns server and get answers (default: any)
allow-query { any; };

// Do we permit recursion for our internal hosts, and retrieve data from the cache for them? (default: no)
recursion yes;

listen-on { any; };

// Who can get entire zone files from this dns server (default : none)
allow-transfer {
127.0.0.1;
10.10.100.3;
};

// How many recursive clients does this dns support per second? (the default is 1000)
recursive-clients 100;

// Do we notify zone changes? Prevent DoD attacks (default: no)
notify yes;

// specifies which hosts are allowed to get answers from the cache (default: any)
allow-query-cache { any; };

// Does this server using two or more master servers? (default: yes)
multi-master yes;

// sets the maximum time (in seconds) for which the server will cache negative (NXDOMAIN) answers
max-ncache-ttl 300; //5min

// Hide version number (default: "")
version "";

// bombing sources add here (default: none)
blackhole { none; };
};

logging {
channel bindlog {
file "/var/log/querylog" versions 3 size 5m;
print-time yes;
print-category yes;
print-severity yes;
};
category xfer-out { bindlog;};
category xfer-in { bindlog;};
category security { bindlog;};
};

// we are the master server for gani.com
zone "gani.com" IN {
type master;
file "master/gani.com.frwd.db";

};

zone "100.10.10.in-addr.arpa" IN {
type master;
file "master/gani.com.rev.db";

};




//RNDC

key "rndckey" {
algorithm hmac-md5;
secret "bIbdf9g/H5q0zogV48tMWw==";
};

controls {
inet * port 953
allow { 127.0.0.1; 10.10.100.0/24; } keys { "rndckey"; };
};

Last edited by Ganesh-vrc; 08-15-2016 at 03:35 PM. Reason: Changing Title
 
Old 08-15-2016, 11:08 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Subject:

Bad: "Help Me!!" or "URGENT"
Good: "Why is my mouse pointer wrong?"
Best: "Mouse pointer distorted on XFree86 4.3 with Geforce FX 5200"

Welcome to LQ.
 
1 members found this post helpful.
Old 08-15-2016, 11:09 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Ganesh-vrc View Post
Please Help..!
I have configured my DNS server with logging channel but still log is writing to /var/log/message file.
Code:
options {

// Default zone file directory for this dns server
directory "/var/named";

// Who can perform queries against this dns server and get answers (default: any)
allow-query { any; };

// Do we permit recursion for our internal hosts, and retrieve data from the cache for them? (default: no)
recursion yes;

listen-on { any; };

// Who can get entire zone files from this dns server (default : none)
allow-transfer {
127.0.0.1;
10.10.100.3;
};

// How many recursive clients does this dns support per second? (the default is 1000)
recursive-clients 100;

// Do we notify zone changes? Prevent DoD attacks (default: no)
notify yes;

// specifies which hosts are allowed to get answers from the cache (default: any)
allow-query-cache { any; };

// Does this server using two or more master servers? (default: yes)
multi-master yes;

// sets the maximum time (in seconds) for which the server will cache negative (NXDOMAIN) answers
max-ncache-ttl 300; //5min

// Hide version number (default: "")
version "";

// bombing sources add here (default: none)
blackhole { none; };
};

logging {
channel bindlog {
file "/var/log/querylog" versions 3 size 5m;
print-time yes;
print-category yes;
print-severity yes;
};
category xfer-out { bindlog;};
category xfer-in { bindlog;};
category security { bindlog;};
};

// we are the master server for gani.com
zone "gani.com" IN {
        type master;
        file "master/gani.com.frwd.db";

};

zone "100.10.10.in-addr.arpa" IN {
type master;
file "master/gani.com.rev.db";

};




//RNDC

key "rndckey" {
        algorithm hmac-md5;
        secret "bIbdf9g/H5q0zogV48tMWw==";
};

controls {
    inet * port 953
    allow { 127.0.0.1; 10.10.100.0/24; } keys { "rndckey"; };
};
First, please read the "Question Guidelines" link in my posting signature, as well as the LQ Rules. Titles such as "help me" are meaningless, and tell no one anything about the issue. Also, without any details, there is NOTHING we can tell you...you don't tell us anything about version/distro of Linux, what you've done/tried so far, any error(s) you're getting, the environment, etc. We can't guess. And please post such huge blocks of configs in CODE tags.

That said, your logging setup looks correct. The documentation can give you many hints...have you looked at any?? Check the permissions on the log file mentioned in your configuration, and the permissions on the DIRECTORY it's in, to make sure the user that your DNS service is running as, has permissions to write to it. Also, are you running in a chrooted environment?? If so, your path needs to reflect that...something like "/var/named/chroot/var/named/named.log"
 
Old 08-15-2016, 11:21 AM   #4
Ganesh-vrc
LQ Newbie
 
Registered: Aug 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile Issue with DNS Logging Channel

Quote:
Originally Posted by TB0ne View Post
First, please read the "Question Guidelines" link in my posting signature, as well as the LQ Rules. Titles such as "help me" are meaningless, and tell no one anything about the issue. Also, without any details, there is NOTHING we can tell you...you don't tell us anything about version/distro of Linux, what you've done/tried so far, any error(s) you're getting, the environment, etc. We can't guess. And please post such huge blocks of configs in CODE tags.

That said, your logging setup looks correct. The documentation can give you many hints...have you looked at any?? Check the permissions on the log file mentioned in your configuration, and the permissions on the DIRECTORY it's in, to make sure the user that your DNS service is running as, has permissions to write to it. Also, are you running in a chrooted environment?? If so, your path needs to reflect that...something like "/var/named/chroot/var/named/named.log"
====================================

Thanks for your help.

I am using chroot as you said and have required permissions on the file and folder. I have update the syslog.conf and restarted the services but still named logs are going to /var/log/messages.



# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

# rpm -q bind
bind-9.3.6-4.P1.el5_4.2

named process
named 3532 1 0 05:28 ? 00:00:00 /usr/sbin/named -u named -t /var/named/chroot


File permission
# pwd
/var/named/chroot/var/log
-rwxrwxrwx 1 named named 0 Aug 13 04:35 querylog

Folder Permission
/var/named/chroot/var
drwxrwxr-x 2 named named 4096 Aug 13 04:37 log


/etc/syslog.conf
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages
named /va/log/querylog

# The authpriv file has restricted access.
authpriv.* /var/log/secure

# Log all the mail messages in one place.
mail.* -/var/log/maillog


# Log cron stuff
cron.* /var/log/cron

# Everybody gets emergency messages
*.emerg *

# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler

# Save boot messages also to boot.log
local7.* /var/log/boot.log
 
Old 08-15-2016, 12:11 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Ganesh-vrc View Post
I am using chroot as you said and have required permissions on the file and folder. I have update the syslog.conf and restarted the services but still named logs are going to /var/log/messages.

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

# rpm -q bind
bind-9.3.6-4.P1.el5_4.2

named process
named 3532 1 0 05:28 ? 00:00:00 /usr/sbin/named -u named -t /var/named/chroot

File permission
# pwd
/var/named/chroot/var/log
-rwxrwxrwx 1 named named 0 Aug 13 04:35 querylog

Folder Permission
/var/named/chroot/var
drwxrwxr-x 2 named named 4096 Aug 13 04:37 log
Code:
/etc/syslog.conf
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
named                                                   /va/log/querylog

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog


# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 *

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log
As said before, please put things in CODE tags. And as said in my previous post, you have defined the log file in the bind configuration...THAT PATH DOES NOT REFLECT the chroot environment, neither does what you posted here for syslog. And after making changes to those files, you have to restart them...did you? Did you check the permissions on the ENTIRE path for the chroot'ed file????
 
Old 08-15-2016, 12:19 PM   #6
Ganesh-vrc
LQ Newbie
 
Registered: Aug 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Yes I have checked the file permission and everything seem to be ok. Could you please let me know if anything missing


# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

# rpm -q bind
bind-9.3.6-4.P1.el5_4.2

named process
named 3532 1 0 05:28 ? 00:00:00 /usr/sbin/named -u named -t /var/named/chroot

File permission
# pwd
/var/named/chroot/var/log
-rwxrwxrwx 1 named named 0 Aug 13 04:35 querylog

Folder Permission
/var/named/chroot/var
drwxrwxr-x 2 named named 4096 Aug 13 04:37 log
 
Old 08-15-2016, 12:35 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Ganesh-vrc View Post
Yes I have checked the file permission and everything seem to be ok. Could you please let me know if anything missing

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

# rpm -q bind
bind-9.3.6-4.P1.el5_4.2

named process
named 3532 1 0 05:28 ? 00:00:00 /usr/sbin/named -u named -t /var/named/chroot

File permission
# pwd
/var/named/chroot/var/log
-rwxrwxrwx 1 named named 0 Aug 13 04:35 querylog

Folder Permission
/var/named/chroot/var
drwxrwxr-x 2 named named 4096 Aug 13 04:37 log
AGAIN, since you either missed it or ignored it the last two times:
  • Check the ENTIRE PATH of the file name for correct permissions.
  • The path you've posted in both the bind and syslog configs are NOT CORRECT for a chrooted path.
  • After editing those files, you need to restart the service.
You're missing ALL of those in your response...posting the same things again doesn't help, and if you did check the aforementioned items, you now need to post the results of those commands.

And, since you're using RHEL, have you contacted Red Hat support?? You are PAYING FOR RHEL, RIGHT????
 
Old 08-15-2016, 12:36 PM   #8
Ganesh-vrc
LQ Newbie
 
Registered: Aug 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Now I have added below entry in /etc/syslog.conf. But now logs is writing up in both file ie.. /var/log/messages and /var/named/chroot/var/log/querylog


daemon.* /var/named/chroot/var/log/querylog


=============================

# cat /etc/syslog.conf
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages
daemon.* /var/named/chroot/var/log/querylog

# The authpriv file has restricted access.
authpriv.* /var/log/secure

# Log all the mail messages in one place.
mail.* -/var/log/maillog


# Log cron stuff
cron.* /var/log/cron

# Everybody gets emergency messages
*.emerg *

# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler

# Save boot messages also to boot.log
local7.* /var/log/boot.log
 
Old 08-15-2016, 12:37 PM   #9
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by TB0ne View Post
AGAIN, since you either missed it or ignored it the last two times:
  • Check the ENTIRE PATH of the file name for correct permissions.
  • The path you've posted in both the bind and syslog configs are NOT CORRECT for a chrooted path.
  • After editing those files, you need to restart the service.
You're missing ALL of those in your response...posting the same things again doesn't help, and if you did check the aforementioned items, you now need to post the results of those commands.

And, since you're using RHEL, have you contacted Red Hat support?? You are PAYING FOR RHEL, RIGHT????
You forgot to mention the missing CODE tags again. ;-)
 
Old 08-15-2016, 12:41 PM   #10
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Do you realize that you posted your secret key allowing anyone with access to modify your DNS servver?
 
Old 08-15-2016, 12:46 PM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Ganesh-vrc View Post
Now I have added below entry in /etc/syslog.conf. But now logs is writing up in both file ie.. /var/log/messages and /var/named/chroot/var/log/querylog
Code:
daemon.*                              /var/named/chroot/var/log/querylog
# cat /etc/syslog.conf
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
daemon.*                              /var/named/chroot/var/log/querylog

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog

# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 *

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log
ONCE AGAIN, PLEASE USE CODE TAGS..this is now the THIRD TIME you've been told/asked. Is there a particular reason you're ignoring things?

And think about what you've posted. "daemon.*" is going to one file...and *.info is going to messages. This means that daemon.info is ALSO going to messages, isn't it????
 
1 members found this post helpful.
Old 08-15-2016, 12:48 PM   #12
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by hydrurga View Post
You forgot to mention the missing CODE tags again. ;-)
No..he didn't post a file that time, just a list of commands, thanks.
Quote:
Originally Posted by smallpond
Do you realize that you posted your secret key allowing anyone with access to modify your DNS servver?
That has to be the funniest thing I've ever seen... I didn't notice that, until you pointed it out.
 
Old 08-15-2016, 12:50 PM   #13
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by TB0ne View Post
No..he didn't post a file that time, just a list of commands, thanks.
Ah, I tend to put those in CODE tags as well. Thanks, and keep up the great work.
 
Old 08-15-2016, 03:25 PM   #14
Ganesh-vrc
LQ Newbie
 
Registered: Aug 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Issue Resolved

Quote:
Originally Posted by hydrurga View Post
Ah, I tend to put those in CODE tags as well. Thanks, and keep up the great work.
"Issue Resolved. Thankyou very much for your help.

Sorry I did not know how to use CODE tags.

This DNS servers are my lab box, so no harm in sharing rndc key "
 
Old 08-15-2016, 03:39 PM   #15
Ganesh-vrc
LQ Newbie
 
Registered: Aug 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile Thankyou...

Quote:
Originally Posted by hydrurga View Post
Ah, I tend to put those in CODE tags as well. Thanks, and keep up the great work.
Quote:
Originally Posted by TB0ne View Post
ONCE AGAIN, PLEASE USE CODE TAGS..this is now the THIRD TIME you've been told/asked. Is there a particular reason you're ignoring things?

And think about what you've posted. "daemon.*" is going to one file...and *.info is going to messages. This means that daemon.info is ALSO going to messages, isn't it????
Thankyou... I have fixed this and now all looks Good
 
  


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
Remapping a Northgate Omnikey "Omni" button to serve as a "Windows" or "Super" key. CVAlkan Linux - Hardware 6 01-07-2019 12:21 PM
[SOLVED] X: "loading extension glx" "no screens found" "fatal server error" (w/ nvidia driver) Geremia Slackware 7 12-29-2014 11:00 AM
[SOLVED] "net rpc" "failed to connect to ipc$ share on" or "unable to find a suitable server" larieu Linux - General 0 11-09-2014 12:45 AM
unpredictable "delete" "move to trash" or "cut" file menu option dorianrenato Linux - General 3 11-28-2011 06:41 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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