Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question

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.

share|improve this answer
    
Thats what i thought too but its only showing me the reverse dns arpa zones – DuPie Jun 21 '12 at 18:22
    
I would check the log files for more information. If only the reverse ARPA zones are in the dump file, I would say that only these are loaded in the DNS server. – Vladimir Blaskov Jun 21 '12 at 18:25

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.

share|improve this answer

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.

share|improve this answer

The following is the exact command to list the zones that are loaded during startup. This is tested on RHEL6.7 x86_64.

/usr/sbin/named-checkconf -z -t /var/named/chroot | grep loaded

Example:

[root@dnsserver ~]# /usr/sbin/named-checkconf -z -t /var/named/chroot | grep loaded
zone 0.0.127.in-addr.arpa/IN: loaded serial 2008040700
zone 19.58.10.in-addr.arpa/IN: loaded serial 2008040701
zone 11.54.10.in-addr.arpa/IN: loaded serial 2008040700
zone example.com/IN: loaded serial 2008040702
zone ./IN: loaded serial 2008040700
share|improve this answer
2  
please explain more. – Sven Jan 13 at 9:07
    
Please refer the edited answer. – Sasikumar K Jan 27 at 4:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.