Master / slave replication using rndc

When I use the traditional method of managing zone files, I can set the following configuration /etc/bind/named.conf.localto configure 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 rndczones to manage my files, how do I manage these replication relationships?

+3
source share
1 answer

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

Adding and Removing a Zone Using rndc

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

allow-new-zones yes;

add 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 the changed zone

rndc reload mydomain.com

remove zone

rndc delzone mydomain.com
+2
source

All Articles