Posts: 147
Joined: Wed Oct 24, 2012 10:19 pm

How to retrieve bind9 statistics

Wed Sep 10, 2014 5:58 am

Hello All,

Following the very nice instructions given here : ... untu-14-04
I installed a bind9 DNS server on my RPI.

Now I want to see some statistics how efficient the caching works in the DNS server for my home network.

* I want to see the count of DNS data base entries grow i.e. when www surfing
* I want to see how many requests were satisfied from the local cache
* File size growth of the local cache (where is the cache actually?)

How can I get all these infos from the bind9?


Posts: 85
Joined: Thu Jul 19, 2012 10:19 am

Re: How to retrieve bind9 statistics

Wed Sep 10, 2014 11:12 am

That's a good guide. Nice find. Add that to the existing Raspbian config (which is quite good at setting up the default zones which even a forwarder should serve rather than recurse).

Not sure why they are forcing IPv4 only. It works fine on my IPv4+IPv6 home network.

Anyways, the answer is in two parts. (1) record stats

Code: Select all

options {
  statistics-file "/var/lib/bind/stats";
  zone-statistics yes;
You can also turn on or off zone statistics by zone

Code: Select all

zone "localhost" {
  type master;
  file "/etc/bind/db.local";
  zone-statistics no;
(2) analyse stats. You probably just want a simple RRD-based tool like dnsgraph. CollectD also does a good job, but perhaps it's resource demands are a little too much for the RPi.

Return to “Networking and servers”