[solution] DNS Clustering: Transfer single or many domains to multiple servers

roman_m

Verified User
Joined
May 5, 2005
Messages
130
Location
Ukraine, Kiev
It's a strange situation, but I need to transfer one single domain to many of my servers using DirectAdmin. I looking at "Multiserver setup" and found it wery usable, but not in my case, because I don't need to transfer all zones around my servers, but one single zone with custom IN NS records

myexamplehost.net. IN NS ns1.myexamplehost.net.
myexamplehost.net. IN NS ns2.myexamplehost.net.
myexamplehost.net. IN NS ns3.myexamplehost.net.
myexamplehost.net. IN NS ns5.myexamplehost.net.

This is host with root NS for all other zones on my servers, which have 2 NS records ns1.myexamplehost.net and ns2.myexamplehost.net. ns2 is my secondary for all my DA servers, not using DirectAdmin, just BSD box with named and plain scripts.

First, I created custom named.db on ns1.myexamplehost.net template with entry
(located in directadmin/data/templates/custom/)

Code:
|* DOMAIN="myexamplehost.net"|
|DOMAIN|. 14400   IN      NS      ns1.myexamplehost.net.
|DOMAIN|. 14400   IN      NS      ns2.myexamplehost.net.
|DOMAIN|. 14400   IN      NS      ns3.myexamplehost.net.
|DOMAIN|. 14400   IN      NS      ns5.myexamplehost.net.
|*else|
|DOMAIN|. 14400   IN      NS      ns1.myexamplehost.net.
|DOMAIN|. 14400   IN      NS      ns2.myexamplehost.net.
|*endif|
In second, I decided to use a custom/dns_write_post.sh which is simple shell wrapper
to directadmin/scripts/custom/dnsengine.pl (see attachment)

Code:
#!/bin/bash
/usr/bin/perl /usr/local/directadmin/scripts/custom/dnsengine.pl
And, at last, complete set of perl scripts is attached, including my Direct::Admin module with LWP::UserAgent authentication and simple-to-understand interface.

Somebody find this useful, I think.

View attachment 1367

I using DirectAdmin about 6 years on my hosting servers and find it very powerful, fast and highly configurable hosting control panel. With a bit of scripting it can turn itself into airplane! ;)
 
Last edited:

scsi

Verified User
Joined
Aug 19, 2008
Messages
4,695
So go on your 2nd server and setup the domain in dns. Follow guides on the internet to setup master slave bind and then use axfr to transfer the zone.
 

roman_m

Verified User
Joined
May 5, 2005
Messages
130
Location
Ukraine, Kiev
I think he already done it.
Of course, I done it 6 years ago :)

My solution provide multi-master fully-redundant DNS scheme as like as DirectAdmin Multi Server Feature, but transfers only choosen domain (one at this moment or more after some modifications).
 
Top