Park domain(s) on another account upon termination.


Well-Known Member
Jan 29, 2007
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 :)



Well-Known Member
Apr 29, 2005
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.