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.
Reply
 
Thread Tools Display Modes
  #1  
Old 17th September 2007, 10:09
jorizzzz jorizzzz is offline
Member
 
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 Automate DNS slave creation

i've got two servers here, each one has an installation of ISPConfig installed. Server1 is my webserver and is the master for the dns, Server2 is the slave.

Is it possible to automate the creation of the slave entries on the second ISPConfig server? At this point, whenever a reseller of mine adds a new domain, i've got to logon the second server and add the slave entry manually.

The updates are being pushed perfectly, all that is working. Only the creating of the slave entries is a problem at this time...

Could somebody help me?
Reply With Quote
Sponsored Links
  #2  
Old 17th September 2007, 23:14
mlz mlz is offline
Senior Member
 
Join Date: Dec 2006
Posts: 189
Thanks: 16
Thanked 9 Times in 9 Posts
Default

This is where MyDNS would be handy, you would just point both DNS servers to the same MySQL database (replicated of course) and let it run, both would have the same zones and records files(so to speak) available. Basically you need to figure out a way to pass from Server A to Server B, the names of the domains to replicate/create in named.conf and let it do it's thing. A simple set of php scripts could do the heavy lifting, but be sure to lock down the security such that only the two machines can talk to each other.

I would expect you would have to at least put a call into the ISPConfig code to run said script however... I'm not sure where, since I've about given up on hacks to ISPConfig 2.x hacks, everytime I do it, I upgrade and forget to back up my hacks..
Reply With Quote
  #3  
Old 21st September 2007, 14:51
grant grant is offline
Junior Member
 
Join Date: Sep 2007
Posts: 14
Thanks: 0
Thanked 15 Times in 4 Posts
Default

To have it run a script when you update something, add the script to the end of:

/root/ispconfig/scripts/writeconf.php

Add things write above the line that says:

Code:
echo "ende\n";
And, if you're hacking about in ISPConfig's files, remember to at least keep a list of every file you've changed (or better, copy the original file to a save location, as "filename.original" and when done, copy the new one there as "filename.new" so you can run diff on them to see what changes you need to make when you upgrade).
Reply With Quote
  #4  
Old 1st October 2007, 17:48
crayz1 crayz1 is offline
Junior Member
 
Join Date: Sep 2007
Location: Frankfort, IN
Posts: 16
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jorizzzz
i've got two servers here, each one has an installation of ISPConfig installed. Server1 is my webserver and is the master for the dns, Server2 is the slave.

Is it possible to automate the creation of the slave entries on the second ISPConfig server? At this point, whenever a reseller of mine adds a new domain, i've got to logon the second server and add the slave entry manually.

The updates are being pushed perfectly, all that is working. Only the creating of the slave entries is a problem at this time...

Could somebody help me?
I am interested in this as well.

I posted a topic in the Installation forum
http://www.howtoforge.com/forums/sho...79&postcount=7

Basically I have a web server with ISPConfig and Master/Slave DNS machines. I want the ISPConifg web server to manage the creation of DNS zones and send it to my DNS machines. I was thinking that my DNS machines both need to act as slaves to the ISPConfig web server, but when resolving name servers on the web the DNS machines would play their Master/Slave role.
Reply With Quote
  #5  
Old 1st October 2007, 18:10
mccharlet mccharlet is offline
Senior Member
 
Join Date: Feb 2007
Posts: 261
Thanks: 60
Thanked 11 Times in 7 Posts
Default

Hi,

I have not solution for autocreate au dns zone
__________________
Thanks
Cédric

Sorry for my english

Hosting : http://www.jheberge.ch

Last edited by mccharlet; 1st October 2007 at 18:46.
Reply With Quote
  #6  
Old 8th October 2007, 06:20
lewis_saint lewis_saint is offline
Member
 
Join Date: Mar 2007
Posts: 69
Thanks: 0
Thanked 3 Times in 2 Posts
Default

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:
Code:
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:
Code:
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 { 123.123.123.123; };"      >> /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
done

/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
The Following 2 Users Say Thank You to lewis_saint For This Useful Post:
jbravo (21st November 2007), zeeman (10th April 2008)
  #7  
Old 8th October 2007, 09:48
jorizzzz jorizzzz is offline
Member
 
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

This looks like a stable solution, i'll give it a go. Thanks a million times

Question tho... Won't this result in a very long list on the slave server with duplicate entries? It exports the entire master server every time...

Last edited by jorizzzz; 8th October 2007 at 09:59.
Reply With Quote
  #8  
Old 10th April 2008, 23:27
zeeman zeeman is offline
Junior Member
 
Join Date: Feb 2007
Posts: 22
Thanks: 7
Thanked 2 Times in 2 Posts
Send a message via ICQ to zeeman
 
Default

I prefer keeping dead threads dead, but to complete the last question:
Quote:
Won't this result in a very long list on the slave server with duplicate entries? It exports the entire master server every time...
No. It doesn't:
Code:
echo > /etc/bind/slave-zones.conf
Before every run the slave-zones.conf is flushed.
Reply With Quote
Reply

Bookmarks

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
Slave DNS issues wadoo99 Installation/Configuration 6 24th October 2007 21:11
DNS Configuration Problems VMartins Installation/Configuration 10 24th July 2007 14:40
Unable send receive emails vassilis3 Installation/Configuration 15 19th May 2007 14:34
SuSE as master DNS server and Centos as slave DNS server... sthompson Server Operation 3 17th September 2006 13:24
Pri & Slave DNS HOWTO (FC4) ppettigrew Suggest HOWTO 0 1st April 2006 15:35


All times are GMT +2. The time now is 01:46.


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