I am trying to get an accurate estimate of how many queries/{day,week,month} my DNS servers process for a specific subset of zones. I ran "rndc stats" and got a statistics file out of the deal, but it includes queries for ALL zones, and I need statistics for only a subset. I have the thought that this can be accomplished by adding "zone-statistics no" to the zone{ } part of the zone file, but I'm not confident to just try it and see what happens. Is this the correct procedure, or is there another way?
OS: OpenSuSE 11.2 BIND: 9.5
Thanks,
Kendall
zone-statistics
is the way.You either set it
yes
globally (in "options") and setno
for non-interesting zones, or vice-versa - setno
globally andyes
for zones of interest.--cut here--
Actually you have 3 ways to obtain statistics:
Obviously if what you need is just statistics, 1 and 2 are the right ways. To control them per-zone you use
zone-statistics
statement. Logging (3) can't be controlled per zone inside BIND.This isn't particularly elegant, but here goes.
In your configuration (same place you'd put
zone{}
blocks, but not inside one), add something like this:You'd be responsible for analyzing the file (
grep ... | wc
or something) yourself.You might also want to consider log rotation if you don't want the file to grow forever. Bind has some built-in support for rolling over logs based on file size or
named
restarts, or you could use something external like logrotate. Bind's logging options are detailed at http://www.zytrax.com/books/dns/ch7/logging.htmlBind support statistics. Cjeck the detail in the Bind 9 Configuration Reference. I think you want to set zone-statistics to yes to do what you want.