bind9 新增 log

bind 9 在 debian 沒有log可以查詢 需另位新增

apt insatll rsyslog

1.
mkdir /var/log/named
chown bind.bind /var/log/named

2.
vi /etc/bind/named.conf.option
不要在 option{};裡,直接 最下面新增
logging {
channel default_log {
file "/var/log/named/default.log";
print-time yes;
print-category yes;
print-severity yes;
severity dynamic;
};
channel general_log {
file "/var/log/named/general.log";
print-time yes;
print-category yes;
print-severity yes;
severity dynamic;
};
channel notify_log {
file "/var/log/named/notify.log";
print-time yes;
print-category yes;
print-severity yes;
severity dynamic;
};
channel network_log {
file "/var/log/named/network.log";
print-time yes;
print-category yes;
print-severity yes;
severity dynamic;
};
channel queries_log {
file "/var/log/named/queries.log";
print-time yes;
print-category yes;
print-severity yes;
severity dynamic;
};
channel query-errors_log {
file "/var/log/named/query-errors.log";
print-time yes;
print-category yes;
print-severity yes;
severity dynamic;
};
channel lame-servers_log {
file "/var/log/named/lame-servers.log";
print-time yes;
print-category yes;
print-severity yes;
severity dynamic;
};
category default { default_log; };
category general { general_log; };
category notify { notify_log; };
};

3.
最後在 named-checkconf /etc/name.conf.option 確認有無錯誤
systemctl restart named

本篇發表於 linux, linux-bind。將永久鍊結加入書籤。

發表迴響

您的電子郵件位址並不會被公開。 必要欄位標記為 *

*

您可以使用這些 HTML 標籤與屬性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>