kyleodonnell
Verified User
- Joined
- Oct 8, 2008
- Messages
- 11
First run of the howto let me know if you find any issues.
MASTER Server
edit /etc/named.conf
add:
to the options section where xx.xx.xx.xx is the ip of your slave server.
Create a script with the following:
somedirectory is the directory on your SLAVE server to store the slave zones.
yy.yy.yy.yy is your MASTER server ip
somewwwdir is a directory browsable via http
someslavefile.conf is the output file to write you slave config
Test the script to ensure it is writing out the appropriate format.
Run the script as any user with permission to write to an http visible directory via cron.
SLAVE SERVER
Edit ns1rndc.key and change the name of the key definition.
Edit named.conf
add the following to the options section
append the following to the file:
Run the following commands
create a script:
Add to root cron
MASTER Server
edit /etc/named.conf
add:
Code:
allow-transfer { [B]xx.xx.xx.xx[/B]; };
to the options section where xx.xx.xx.xx is the ip of your slave server.
Create a script with the following:
Code:
#!/bin/sh
#
for domain in `/bin/grep ^zone /etc/named.conf |/bin/grep "type master" |/bin/awk '{print $2}' |/bin/awk -F\" '{print $2}'`
do
/usr/bin/printf "zone \"${domain}\" { type slave; file \"/var/named/slaves/[B]somedirectory[/B]/${domain}.db\"; masters { [B]yy.yy.yy.yy[/B]; }; };\n"
done > /var/www/html/somewwwdir/someslavefile.conf
somedirectory is the directory on your SLAVE server to store the slave zones.
yy.yy.yy.yy is your MASTER server ip
somewwwdir is a directory browsable via http
someslavefile.conf is the output file to write you slave config
Test the script to ensure it is writing out the appropriate format.
Run the script as any user with permission to write to an http visible directory via cron.
Code:
0 4 * * * /path/to/script > /dev/null 2>&1
SLAVE SERVER
Code:
scp MASTERSERVER:/etc/rndc.key /etc/ns1rndc.key
Edit ns1rndc.key and change the name of the key definition.
Edit named.conf
add the following to the options section
Code:
allow-transfer { [B]zz.zz.zz.zz[/B]; };
append the following to the file:
Code:
include "/etc/ns1rndc.key";
include "/path/to/[B]someslavefile.conf[/B]";
Run the following commands
Code:
touch /path/to/[B]someslavefile.conf[/B]
mkdir /var/named/slaves/[B]somedirectory[/B]/
chown -R named:named /var/named/slaves/[B]somedirectory[/B]/
/etc/init.d/named restart
create a script:
Code:
#!/bin/sh
/usr/bin/wget [url]http://[B]yy.yy.yy.yy[/url][/B]/[B]somewwwdir[/B]/[B]someslavefile.conf[/B] -O /var/named/slaves/[B]someslavefile.conf[/B]
/etc/init.d/named restart
Add to root cron
Code:
0 4 * * * /path/to/script
Last edited: