Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge Branko's Avatar
    Join Date
    Sep 2005
    Posts
    36
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb Bulk dns zone ttl editor script

    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...S/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
    Attached Files
    Last edited by Branko; 10-29-2008 at 06:55 PM.

  2. #2
    Member
    Join Date
    Oct 2006
    Posts
    49

    Default

    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.

  3. #3
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.

  4. #4
    cPanel Partner NOC cPanel Partner NOC Badge Branko's Avatar
    Join Date
    Sep 2005
    Posts
    36
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by cPanelDavidG View Post
    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

    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.

  5. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by Branko View Post
    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
    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.

  6. #6
    Member
    Join Date
    Sep 2001
    Posts
    315

    Default

    At least my WHM don't have this function yet. I have it for single account transfer, but not for multiple account transfers.

    Michael

  7. #7
    Member
    Join Date
    Dec 2002
    Location
    Australia
    Posts
    65

    Default

    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!

  8. #8
    cPanel Partner NOC cPanel Partner NOC Badge Branko's Avatar
    Join Date
    Sep 2005
    Posts
    36
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Quote Originally Posted by CoolMike View Post
    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.

  9. #9
    Member
    Join Date
    Mar 2002
    Posts
    31

    Default

    Quote Originally Posted by cPanelDavidG View Post
    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 by websnail.net; 09-24-2008 at 07:03 AM.

Similar Threads & Tags
Similar threads

  1. %ttl% variable in DNS zone templates?
    By jez9999 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-24-2005, 04:20 PM
  2. %ttl% variable in DNS zone templates?
    By jez9999 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-24-2005, 05:25 AM
  3. dns zone template , which one to change TTL?
    By gundamz in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-23-2005, 03:46 AM
  4. Changing TTL's in dns zone file
    By GlennC in forum New User Questions
    Replies: 1
    Last Post: 01-26-2005, 09:53 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube