[dns-operations] cheap traffic measure for a small set of zones

Tony Finch dot at dotat.at
Fri Mar 26 19:10:54 UTC 2021


Randy Bush <randy at psg.com> wrote:

> is there a simple tool to run on a server to measure query and data
> rates for a small set of zones?  i just want to run it for a day.
>
> it is a a bind9 server which serves a few hundred zones.  i would like
> to know the query rate and byte count for six of them.

I usually use BIND's built-in statistics server for this kind of thing,
but it looks like it can count queries per zone but not bytes per zone.
(my servers are configured with `zone-statistics full;`)

e.g.

$ curl -sf http://auth0:8053/json/v1 |
	jq -r '.views.main.zones[] |
		"\(.name) \((.rcodes.QryUDP) + (.rcodes.QryTCP))"' |
	grep ^cam.ac.uk
cam.ac.uk 1294381958

That's queries since the server started.

[ jq is a bit of a puzzle language; I often prefer gron | grep ]

https://stedolan.github.io/jq/
https://github.com/TomNomNom/gron

Tony.
-- 
f.anthony.n.finch  <dot at dotat.at>  https://dotat.at/
Fair Isle: Westerly, backing southerly later, 5 to 7, perhaps gale 8
later in west. Rough or very rough, occasionally moderate in
southeast. Wintry showers. Good, occasionally poor.




More information about the dns-operations mailing list