Error removing subdomain with cpapi2
Hi
This is an example:
My main domain is "server.com"
I want to create an add on domain "addon.com"
So I run:
cpapi2 AddonDomain addaddondomain dir=/ newdomain=addon.com subdomain=addon.com
This creates an add on domain:
addon.com
and, in addon.com DNS zone, a lot of A and TXT records, as:
addon.com.server.com. A
www.addon.com.server.com. A
default._domainkey.addon.com.server.com. TXT
addon.com.server.com. TXT
webmail...
whm...
webdisk...
etc.
So far so good.
Now, if I try to delete the domain running:
cpapi2 AddonDomain deladdondomain domain=addon.com subdomain=addon.com.server.com
This doesn't work. This is the output
cpanelresult:
apiversion: 2
data:
-
reason: "You do not have control of the subdomain for “addon.com”.\n\nSubdomain addon.com.server.com was not removed because other domains are parked on top of it"
result: 0
error: "You do not have control of the subdomain for “addon.com”.\n\nSubdomain addon.com.server.com was not removed because other domains are parked on top of it"
event:
result: 1
func: deladdondomain
module: AddonDomain
postevent:
result: 1
preevent:
result: 1
How can I delete the domain? (I can do this manually in CPanel interface, but not using "cpapi2")
-
Hey there! Running the following command worked well for me:
# cpapi2 --user=username AddonDomain deladdondomain domain=addonapitest.com subdomain=addonapi.domain.com
---
cpanelresult:
apiversion: 2
data:
-
reason: The subdomain “addonapi.domain.com” has been removed.
result: 1
event:
result: 1
func: deladdondomain
module: AddonDomain
postevent:
result: 1
preevent:
result: 10
Please sign in to leave a comment.
Comments
1 comment