Enable or disable query logging in Bind.

To enable query logging use:

root# rndc querylog on

To disable query logging use:

root# rndc querylog off

Query logging can also be enabled by explicitly directing the queries category to a channel in the logging section of named.conf or by specifying “querylog yes;” in the options section of “named.conf”.
By default query logging will go to /var/log/messages to avoid this situation, create the logging channels:

logging {
channel default_file {
file "/var/log/named.log" size 100m;
severity dynamic;
print-time yes;
print-severity yes;
print-category yes;
};
channel queries_file {
file "/var/log/queries.log" size 100m;
severity dynamic;
print-time yes;
print-severity yes;
print-category yes;
};
category queries { queries_file; };
category default { default_file; };
};

Leave a Reply

Your email address will not be published. Required fields are marked *

*