Is there an rndc command to get the list of configured zones?

Tony Finch fanf at isc.org
Wed Sep 21 09:43:27 UTC 2022


Klaus Darilion via bind-users <bind-users at lists.isc.org> wrote:

> I checked all options of rndc to get the list of zones configured/served by bind - but I can't find any.
> Is it really not possible to get this list from a running Bind process?

The statistics channel is your friend when rndc lets you down. Below I
have pasted a wee script I have lying around, or you might like JP Mens'
bzl program https://github.com/jpmens/bzl
https://jpmens.net/2010/10/21/using-binds-statistics-server-to-list-zones-and-axfr-the-list/

#!/bin/sh

case $# in
(1)     ;;
(*)     echo 1>&2 'usage: lszones <server>[:port]'
        exit 1
esac

curl -Ssf http://$1/json |
	jq '	.views |
		to_entries |
		.[] |
		.key as $view |
		.value.zones[] |
		"\($view) \(.type) \(.serial) \(.name)"
	'

-- 
Tony Finch  <fanf at isc.org>  (he/they)  Cambridge, England
Fair Isle, Faeroes: South or southwest 5 to 7. Moderate, occasionally
slight, becoming moderate or rough. Occasional rain and fog patches,
showers later in Faeroes. Moderate or good, occasionally very poor.


More information about the bind-users mailing list