Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 11th February 2009, 17:59
jorizzzz jorizzzz is offline
Join Date: May 2007
Location: Soest, Netherlands
Posts: 81
Thanks: 1
Thanked 4 Times in 2 Posts
Send a message via MSN to jorizzzz
Default offsite DNS (master and slave) solution

Hi guys,

I've been struggling a while to get my setup working as i like... In the old setup i had 2 webservers with ISPConfig installed on it. Server 2 was the slave DNS for server 1 and viceversa. This was getting a bit out of hand so i needed a new solution.

I've got two servers (vmware instances) with a new linux installation and only bind installed on the two of them. Below is a plan that i've used for this solution to work. Hopefully it can do good for you too.

If you see anything that's off or that could be done better, please respond! I'm always in for a bit finetuning.

Oh yeah, i've used public key authentication for the scp to work...

1. Copy all of the zone files to the primairy DNS
Webserver 1:

scp /etc/bind/pri.* dns@

Webserver 2:

scp /etc/bind/pri.* dns@
2. Import zone files in master dns server and copy the zonelist to the slave server. Add the following line to named.conf to make bind look into the zones.conf file:
Include /etc/bind/zones.conf
mv /home/dns/zones/pri.* /etc/bind/
rm /home/dns/zonelist
echo > /etc/bind/zones.conf

for a in $(ls /etc/bind/pri.*); do echo ${a#/etc/bind/pri.} >> zonelist; done

for i in `cat /home/dns/zonelist`; do
echo "zone \"$i\" {" >> /etc/bind/zones.conf
echo " type master;" >> /etc/bind/zones.conf
echo " file \"/etc/bind/pri.$i\";" >> /etc/bind/zones.conf
echo "};" >> /etc/bind/zones.conf
echo >> /etc/bind/zones.conf

/etc/init.d/bind9 force-reload > /dev/null

scp /home/dns/zonelist dns@

3. Import the slave zones on the slave DNS server. add the following line in named.conf to tell bind.
Include /etc/bind/slave-zones.conf
echo > /etc/bind/slave-zones.conf
for i in `cat /home/dns/zonelist`; 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 force-reload > /dev/null
rm /home/dns/zonelist
You can alltime this with cronjobs hopefully it will do good

Ok guys, i've been testing a bit and this here isn't working quite yet... I'm having troubles with inserting the zones into the master DNS... I will adjust the code when it does work. If anyone of you got it right, please post it!

*update* I've got it working! above is how i've done it.

Last edited by jorizzzz; 11th February 2009 at 22:34.
Reply With Quote
The Following 3 Users Say Thank You to jorizzzz For This Useful Post:
edge (11th February 2009), falko (12th February 2009), madmucho (16th April 2009)
Sponsored Links
Old 9th March 2009, 17:04
id10t id10t is offline
Senior Member
Join Date: Nov 2008
Posts: 242
Thanks: 2
Thanked 22 Times in 22 Posts

Looks good. Only change I'd make is to not delete the files before re-creating them, but instead make a backup of 'em all into a tar file that is time/date stamped, so should something Go Wrong you can always recover. Maybe back up the actual zone files as well at the same time...
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
set up two dns with public IP master and slave -crisstm- Installation/Configuration 15 13th December 2008 22:18
DNS: installing Master and slave dns server on debian Etch SHELLHOSTER Installation/Configuration 1 28th October 2007 16:08
Slave dns problem blackmask Installation/Configuration 1 3rd October 2007 14:51
SuSE as master DNS server and Centos as slave DNS server... sthompson Server Operation 3 17th September 2006 14:24
Pri & Slave DNS HOWTO (FC4) ppettigrew Suggest HOWTO 0 1st April 2006 16:35

All times are GMT +2. The time now is 12:54.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.