DNS 日志记录通道问题

DNS 日志记录通道问题

我已经使用日志记录通道配置了 DNS 服务器,但日志仍然写入 /var/log/message 文件。

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";

};

答案1

/var/log/messages通常由 syslog 守护程序管理,因此您的绑定可能配置有用于日志记录的默认 syslog 通道(请参阅“BIND 9 管理员参考手册”,第 6.2.10.1 节)。在测试中,即使有:

logging {
  category default { default_debug; };
  ...
};

一些 BIND 启动消息仍然发送到 syslog(对于 BIND 9.10,通过 Mac OS X 上的 MacPorts),尽管我不确定您在 syslog 中看到了什么日志,也不知道它们为什么会出现问题。

相关内容