Question

When I use traditional way to manage my zone files, I can put the follow configuration in /etc/bind/named.conf.local to setup the master/slave replication.

zone "my_zone.com" {
    type master;
    file "/etc/bind/db.my_zone.com";
};

and

zone "my_zone.com" {
    type slave;
    file "db.my_zone.com";
    masters { master_ip_address; };
};

But what if I use rndc to manage my zone files, how should I manage such replication relationship?

Was it helpful?

Solution

After some investigation, I think I find the answer to my own question.

Adding and deleting zone using rndc

to enable rndc to add new zones, add the following code to /etc/bind/named.conf.option:

allow-new-zones yes;

to add a new zone

rndc addzone mydomain.com  '{type master; file "/etc/bind/rndc_zones/mydomain.com";};'
rndc addzone mydomain.com '{ type slave; masters { master_ip; }; };'

to reload modified zone

rndc reload mydomain.com

to remove a zone

rndc delzone mydomain.com
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top