Link to home
Create AccountLog in
Avatar of Chad K
Chad K

asked on

How to configure BIND to store slave zone files in different directory than /var/named (like /var/named/slaves)

I have a Bind installation setup on CentOS7 which is receiving slave files from a master server via RNDC.  Everything is working, however each slave file which is created is done so in the /var/named directory.  I would prefer they get kept in the /var/named/slaves directory.  Is there an easy way to change my named.conf file so that slaves are stored in a different directory than the /var/named?
ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Chad K
Chad K

ASKER

I understand how to use includes to point to config files, but in this case the config file is created via RNDC by a master server and its zones are automatically placed in the root /var/named directory.  I would prefer that the zones which are created by RNDC from the master get placed in the /var/named/slaves directory, but there is nowhere in the named.conf to tell where to place zones created by the "allow_new_zones=yes" switch in that file as far as I can tell?
slightly more creative:

create a directory structure like:

/var/named/rndcroot

and base all zones that ARE DECLARED as:

file "../pri/whaiteverprimary"
file "../slave/whateverslave"

Dan komen alle rndc zones in de andere directory .
De bekende zones eerst een omhoog en dan weer omlaag..


Andere oplossing de juiste locatie opgeven aan rndc:
rndc addzone example.com '{ type master; file "rndc/example.com.db"; };'