Problem parking a domain via API2 Park::park

bmett

Well-Known Member
Aug 5, 2010
71
1
56
Brisbane, AU
Hi everyone,

I'm using the cPanel APi successfully for many different functions: creating account, terminating accounts, DNS functions, etc.
All runs perfectly fine as expected. Only the API2 function Park::park doesn't do what I want.

Simple example:
Existing account: domainname.com.au with acc name: domainna
Domain I want to park on to of the existing account : domainname.com

Both domains are under our management and point to the correct nameserver.

I tried to use the API2 module Park with the function park to park the domain.

PHP:
$acc_name = 'domainna';
$dom_to_park = 'domainname.com';
$dom_top_name = 'domainname.com.au';
$xmlapi->api2_query($acc_name, "Park", "park", array(domain=>$dom_to_park, topdomain=>$dom_top_name);
Unfortunately that doesn't work. I get the following error message:
Code:
{"cpanelresult":{"error":"Error from park wrapper: The following domain is not configured for this account: [B]domainname.com.au.domainname.com.au[/B]: @Cpanel::DOMAINS=(domainname.com.au)\\n","data":[{"result":0,"reason":"Error from park wrapper: The following domain is not configured for this account: domainname.com.au.domainname.com.au: @Cpanel::DOMAINS=(domainname.com.au)\\n"}],"event":{"result":1},"module":"Park","apiversion":2,"func":"park"}}
The only thing in there that makes me wonder is the part I highlighted. Why is the domainname there twice (domainname.com.au.domainname.com.au)?

And now the strange part.
If I go into WHM and try to park the domain via DNS Functions > Park a Domain, it works fine.

Hope someone can help.

Cheers,
Bjorn
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Is domain.com.au the primary domain on that cPanel account? If so, omit the topdomain parameter. Otherwise, from what I'm seeing in the documentation, it would need to be a subdomain (not something like domain.com.au but something like subdomain.domain.com.au).
 
Last edited:

bmett

Well-Known Member
Aug 5, 2010
71
1
56
Brisbane, AU
Hi David,

Thanks for the reply.

I think I figured it out (after your hint of course).

After omiting the topdomain paramter I got a different error:

Error from park wrapper: Using nameservers with the following IPs: 74.86.xxx.xxx,74.86.xxx.xxx Sorry, the domain is already pointed to an IP address that does not appear to use DNS servers associated with this server. Please transfer the domain to this servers nameservers or have your administrator add one of its nameservers to /etc/ips.remotedns and make the proper A entries on that remote nameserver.
So I just added our nameserver IPs to IP Functions >> Configure Remote Service IPs in WHM and after that the parking worked. :D

Thanks David, as always: Awesome support!

Cheers,
Bjorn
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Ahh, good point.

I'm going to speak with one of our guys to see if we can get a blog written on this topic as this seems to be a common stumbling point based on what I've addressed on the forums in the past few weeks :).