View Single Post
Old 8th October 2007, 07:20
lewis_saint lewis_saint is offline
Join Date: Mar 2007
Posts: 69
Thanks: 0
Thanked 3 Times in 2 Posts

I came up with a solution to this problem a number of months ago. I have ISPConfig running on one server, and bind on its own on another. My working setup is as follows:
1. A cronjob daily runs the following on my ISPConfig box:
grep "^zone" /etc/bind/named.conf | grep -v "arpa" | awk -F \" '{print $2}' | awk 'length > 1' > /etc/bind/slave-zones
scp /etc/bind/slave-zones slave-dns@bind9box:slave-zones > /dev/null
Using SSH keys, a file of all of my domains is created on the secondary box daily.

2. A cronjob daily runs the following on my secondary box:
echo > /etc/bind/slave-zones.conf
for i in `cat /home/slave-dns/slave-zones`; do
echo "zone \"$i\" {"                      >> /etc/bind/slave-zones.conf
echo "  type slave;"                >> /etc/bind/slave-zones.conf
echo "  file \"slave.$i\";"         >> /etc/bind/slave-zones.conf
echo "  masters {; };"      >> /etc/bind/slave-zones.conf
echo "  notify no;"  >> /etc/bind/slave-zones.conf
echo "};"                                 >> /etc/bind/slave-zones.conf
echo                                      >> /etc/bind/slave-zones.conf

/etc/init.d/bind9 restart > /dev/null
I have bind9 including /etc/bind/slave-zones.conf in my configuration file.

Let me know how you get on!
Reply With Quote