在 /etc/named.conf 加入如下

logging {
 channel default-log { // 名稱定義
 file "/var/log/named/default.log" versions 20 size 50m; // 記錄檔、保留多少個 (default.log , default.0~19)、檔案最大 50mb就輪替
 severity info; // 什麼等級的程度才記錄
 print-severity yes; // 記錄程度
 print-time yes; // 記錄時間
 print-category yes; // 記錄類別名稱
 };
 channel query-log {
 file "/var/log/named/query.log" versions 20 size 50m;
 severity info;
 print-severity yes;
 print-time yes;
 print-category yes;
 };
 channel security-log {
 file "/var/log/named/security.log" versions 20 size 50m;
 severity info;
 print-severity yes;
 print-time yes;
 print-category yes;
 };
 channel other-log {
 file "/var/log/named/other.log" versions 20 size 50m;
 severity info;
 print-severity yes;
 print-time yes;
 print-category yes;
 };
 category default {default-log;}; // 定義類別記錄到那裡
 category queries { query-log;};
 category security { security-log;};
 category lame-servers { null; };
 category client { other-log;};
 category config { other-log;};
 category database { other-log;};
 category general { other-log;};
};

category 還有其它的,可參考 http://www.zytrax.com/books/dns/ch7/logging.html

severity 可參考 http://docstore.mik.ua/orelly/networking_2ndEd/dns/ch07_05.htm

critical
error
warning
notice
info
debug [level]
dynamic

Related posts 相關文章
dnscrypt-proxy 讓 DNS 查詢加密
More...
DNS BIND 9.16.50 最後一個版本已釋出
More...
DNS BIND 9.16 版本將 EOL
More...
在 Windows 上面 Plesk Obsidian 18.0.60 後不再維護 BIND DNS
More...

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。