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

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

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.

Attachment 1366

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! 😉

Comments are closed.