The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Park domain(s) on another account upon termination.

Discussion in 'cPanel Developers' started by dansgalaxy, Sep 13, 2010.

  1. dansgalaxy

    dansgalaxy Well-Known Member

    Jan 29, 2007
    Likes Received:
    Trophy Points:
    Reading, UK
    cPanel Access Level:
    Root Administrator
    I am currently doing this process by hand, and am looking for how I might be able to achieve the same thing Automagically.

    Basically I need it so when an account is terminated (be it from WHM or API) the postkillact script parks all the domains on that account (unless the DNS zone was kept OR the domain(s) already have zones etc else where, and so long as the NS servers on the domains point to mine) onto another nominated cpanel account.

    As for example at the moment I have a "Terminated" account which has a Terminated holding page explaining this account has been terminated blah blah this is the webhost... So while users domains are still pointing to my servers I can at least get some low level advertising out of them ;)

    How can I achieve this?

    Also, how could I have a script which runs on cron and checks if domains are still pointing to my server(s) and if not, unpark them to save dns zone clutter?

    Ps. If somecan write something nice for this willing to pay a modest amount, although if not pointers would be good for me to do it :)

  2. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Apr 29, 2005
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Well, we can't write this for you, but I can certainlly tell you how.

    First of all, you will need to use two hook scripts:


    This is because that by the time postkillacct executes it will have removed all addon/sub/parked domains.

    The best way to do this is to have /scripts/prekillacct do lookups on the various types of domains via their API2 methods:

    cPanel/WHM Script Hooks
    WebHome < ApiDocs/Api2 < TWiki

    Store them into a flat file somewhere, let killacct do it's thing then use postkillacct to park them elsewhere.

Share This Page