Account terminated but zones still in DNS (no, not checked the "Keep DNS Zone")

Csurgi

Registered
Apr 2, 2013
3
0
1
cPanel Access Level
Root Administrator
Hi!

I created an account (with a q.w.e main domain) via the API, added some addon domain (a.b.c, d.a.b.c, e.a.b.c).

When I terminate the account via WHM UI I see there are deleting something under "Removing Virtual Hosts" section and listed all of the addon domains previously added to this account, but at the "Removing DNS Entries" section are missing the d.a.b.c and e.a.b.c domains, and they are still in the DNS and I can delete these zones vis WHM UI.

There is no account assigned to this domains now.
The "Keep DNS Zone" checkbox was empty.

So it can be a bug or I've done something wrong?
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello :)

I was not able to reproduce this on a test server. Do you notice any error messages in /usr/local/cpanel/logs/error_log when terminating accounts? If not, I suggest opening a support ticket so we can take a closer look:

Submit A Ticket

Thank you.
 

Csurgi

Registered
Apr 2, 2013
3
0
1
cPanel Access Level
Root Administrator
Thank you for the support!

The problem is solved based on the cPanel support reply:

If you use the API to terminate an account, you could build an array of all the zonefiles the account owns by looking at the DNS#= entries in /var/cpanel/users/$user and verify that they are all deleted after the account termination.

Or, you could create the array via /usr/local/cpanel/scripts/prekillacct. And then run the zone check at /usr/local/cpanel/scripts/postkillacct.