0

I'm wondering whether there is a command I can run to get a complete list of the domain names that my BIND9 currently manages on my master DNS server.

Hypothetically, something such as:

named --list

And that would give me all the names of all the zones I have currently setup on that master.


Now, the reason for asking is that the way I've been setting up my slave BIND9 is by adding a new entry for each master entry. For example:

zone "example.app" {
    type slave;
    file "/var/cache/bind/example.app.zone";
    masters {  192.168.0.1;  };
    allow-transfer { none; };
};

This allows my slave BIND9 to ask for the info from the master BIND9. It works and it's find when you have a few entries. When you have like well over 50, it's not just tedious, you make many mistakes and that means no second DNS for those mistakes and like nothing tells you that the second DNS is missing...

I'm thinking that there is probably a much better way to setup the slave saying that any domain name managed by the master is to be replicated on the slave. But I do not want my slave to manage anyone else DNS. So only allow my master (192.168.0.1 in my example) to make changes.

Either solution would be fine with me. The second one would be better, of course.

2

First of all, usually, one only ask one question per post since its better for site lisibility and referencing...

For your first question, you can ask bind to dump the zones it's currently managing, see the dumpdb command of rndc:

  dumpdb [-all|-cache|-zones|-adb|-bad|-fail] [view ...]
                Dump cache(s) to the dump file (named_dump.db).

Nevertheless:

  • not sure it will dump only the zone where the server is master
  • you will have to parse the output cause it's not basically a list of zone but the full dump.

For your second question, there's actually two possibilities:

  1. It looks like bind9 implemented a new feature to manage this, see http://ftp.isc.org/isc/bind9/cur/9.11/doc/arm/Bv9ARM.ch04.html#catz-info

  2. Write a script that would generate slave's configuration from master's one.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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