Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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 :)

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. MattDees

    MattDees Well-Known 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.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice