Avatar of Chad Killion
Chad Killion
 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?
* CentOSDNS* BIND9

Avatar of undefined
Last Comment
noci

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
David Favor

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Chad Killion

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?
noci

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"; };'
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23