Branko

Active Member
PartnerNOC
Sep 16, 2005
36
0
156
cPanel Access Level
DataCenter Provider
Not really sure where to put this, so I figured this should be a good place.

Anyway, probably you have already find yourself in a situation when you have to move a client from one server to another. So to minimize the new ip propagation time one should edit clients dns zones and put as minimal ttl as one can afford.
After account migration, dns records propagate much faster then usual and client don't even notice they have been moved.

When it comes to one account it's all fair and simple, edit zone, wait for 24h, migrate the account, edit zone back. But what when you have like 200+ accounts to migrate, 400+ dns zones, and it's absolutely vital that they have minimum dns propagation time.

Ofc. it would take ages to edit all those zones.

So... faced with so much migration these days, I decided to write this script that should help me in that dns zone editing job.

Script will edit ttl for single or a list of domain names. It changes the zone db file in /var/named/ (if you have your db files placed anywhere else rewrite that). It sets desired ttl, increments the serial, and then invokes cpanel's perl script for that zone dns cluster sync.

It should be pretty easy to use.

It also requires installed http://search.cpan.org/~simonflk/DNS-ZoneParse-0.95/lib/DNS/ZoneParse.pm perl module.

BEFORE YOU USE THIS SCRIPT, MAKE A BACKUP COPY OF YOUR DATA.
USE THIS SCRIPT AT YOUR OWN RISK, AUTHOR TAKES NO RESPONSIBILITY FOR ANY DAMAGE CAUSED BY USING IT.


Ps. Any feedback would be more than welcomed
 

Attachments

Last edited:

vikins

Well-Known Member
Oct 3, 2006
115
1
168
We all need this, but we're all afraid to try it! ;)

I'm going to try it next time I do a big migration. I just finished one, so I don't need it right now. Thank you sharing.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
10
313
Houston, TX
cPanel Access Level
Root Administrator
If you use cPanel/WHM 11.23 on both servers, simply use the option to update DNS on the source server to negate the need for manually editing DNS TTLs during transfers to minimize downtime due to DNS propagation.
 

Branko

Active Member
PartnerNOC
Sep 16, 2005
36
0
156
cPanel Access Level
DataCenter Provider
If you use cPanel/WHM 11.23 on both servers, simply use the option to update DNS on the source server to negate the need for manually editing DNS TTLs during transfers to minimize downtime due to DNS propagation.
Usually I do when there is a need to transfer only few domains, but 20+ already gets pain in the ass to edit.

So you just put domain list in file, and give it to script to do the rest :D

Also thing is... from one of the latest updates in whm/cpanel, during transfers it now remembers custom dns entrys even custom TTLs, so if you forget to re-edit them back, soon you end up with bunch of domains with extremely low TTL. Tbh, thats the real reason why I made this script. :D
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
10
313
Houston, TX
cPanel Access Level
Root Administrator
Usually I do when there is a need to transfer only few domains, but 20+ already gets pain in the ass to edit.

So you just put domain list in file, and give it to script to do the rest :D
Why not use the transfer multiple accounts function and simply check the box? You only need to check the box once for the entire transfer if you are doing a multi-account transfer.

No manual script editing is needed.
 

CoolMike

Well-Known Member
Sep 6, 2001
307
0
316
At least my WHM don't have this function yet. I have it for single account transfer, but not for multiple account transfers.

Michael
 

Kurieuo

Well-Known Member
Dec 13, 2002
106
0
166
Australia
I personally did not want to do multiple account as I have read it does not always carry an account across in one piece.

I used this script and worked like a charm once I installed the perl mod and created the list of files.

Thanks a bunch!
 

Branko

Active Member
PartnerNOC
Sep 16, 2005
36
0
156
cPanel Access Level
DataCenter Provider
At least my WHM don't have this function yet. I have it for single account transfer, but not for multiple account transfers.
Michael
Jeah me neither... and judging by this thread http://forums.cpanel.net/showthread.php?t=76972

that function really don't do the "trick" I want while moving inside same dns cluster. You really need to manually edit zones you wish to move day before, and wait day or two to allow new small ttl propagation time, so when you eventually move the acc. it should propagate it's A, Cname and MX records almost instantaneously.
 

websnail.net

Active Member
Mar 24, 2002
39
1
308
If you use cPanel/WHM 11.23 on both servers, simply use the option to update DNS on the source server to negate the need for manually editing DNS TTLs during transfers to minimize downtime due to DNS propagation.
Unfortunately what this doesn't resolve is those users going to pick up their email from mail.foo.tld...

I've found that every single one of my clients (post move) is connecting to the wrong server to get their email whilst all the email is being delivered to the new one. 24 hour wait pending now for the nameservers to catch up and they'll start getting their emails.
 
Last edited: