看到 http://www.heinet.cn/dnsMonitor/ 上的DNS统计查询比较直观,就写了一段脚本来从DNS的querylog里生成统计页面。
首先起启用bind的querylog记录,并设置最多记录200M,在named.conf中的关键配置是:
logging {
category default{ null; };
channel “querylog” { file “/var/named/data/query.log” size 200m; print-time
yes; };
category queries { querylog; };
};
统计页面在 http://202.38.64.1/dns
2个脚本是 http://202.38.64.1/dns/run http://202.38.64.1/dns/gendata
有兴趣的可以在DNS服务器上加上统计。
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.