Listing all zones loaded in BIND

I'm trying to migrate a dns server that has several thousand zones loaded on it. The named.conf file has about 17 different includes, and some of those files also has includes in them, and lots of commented out etc. It's a fricking mess!

I'm wanting to get a list of all the zones currently loaded into BIND. I looked at rndc dumpdb but it doesn't show me just the zones.

Instead of following the messy include files, is there an easier way to get a list of the authorative zones inside BIND? Thanks!


You can run rndc dumpdb -zones to create a file called cache_dump.db. This file will contain all authoritative zones and will be created in BIND's data directory.


Confirmed rndc dumpdb is the best method.

In my case, i discovered that there was 2 seperate bind instances running on the same server (don't ask), one doing forward dns and one doing reverse dns. Without specifying the PID, it attached to the one only doing reverse dns and only showed me that.


If you just want to have the configuration (including any include files) printed in its canonical form, you could simply call:

named-checkconf -p (optionally with -t /some/chroot/dir if BIND runs chrooted and the config needs to be read from the chroot dir)

This flattens out all the include files, removes all comments and formats everything neatly.

While the output will include statically configured zones, it will not list dynamic zones, like those added with rndc addzone.


Adding -all does the trick for me (on Ubuntu Ubuntu 16.04.2 LTS (xenial))

sudo rndc dumpdb -all && cat /var/cache/bind/named_dump.db