Bulk Add Parked Domains to One Account?

captlid

Registered
May 1, 2019
3
0
1
usa
cPanel Access Level
Root Administrator
Hi, I looked through the documentation and it advises to use the api's. I wrote a script that calls the api, but it's really slow.

I couldn't get the json api working for the life of me.

I used this call
https://hostname:2087/scripts/park?domain=domain.com&ndomain=parkeddomain.net

in a php script using curl. The script runs real slow. No surprise there since it has to make 2000 seperate network calls.

I need to park about 2000 domains.

I have root access to the server. It has whm/cpanel version 78 on centos 6.1.

I wanted to know where the parked domains are stored on the operating system and just copy/paste them in and restart apache to acknowledge the new settings. [There is only cpanel user.]

Also are there any other files besides the apache configuration file that need to be edited?

DNS is being externally managed by my registrar.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello @captlid,

Since you are adding these parked domains (aliases) under a single cPanel account, you can use the following cPanel API 2 function instead:

cPanel API 2 Functions - Park::park - Developer Documentation - cPanel Documentation

Custom development work falls outside the scope of support we offer, however you could reference the following thread as an example of how to develop a custom script on your own (it's for bulk addon domain name removal):

bulk addon domain removal

Thank you.
 
Last edited:

captlid

Registered
May 1, 2019
3
0
1
usa
cPanel Access Level
Root Administrator
Hello @captlid,

Since you are adding these parked domains (aliases) under a single cPanel account, you can use the following cPanel API 2 function instead:

cPanel API 2 Functions - Park::park - Developer Documentation - cPanel Documentation

While it's outside the extent of support we can offer to develop a custom script for you, you could reference the following thread as an example of how to write your own (it's for bulk addon domain name removal):

bulk addon domain removal

Thank you.
Hi Michael, I wrote a script that works and uses the commands given in the cpanel documentation. It takes at least 3 seconds to add each domain. That's 6000 seconds for 2000 domains.

I also tested the cpapi2 command it is also very slow. :(

I also read that thread you are referencing, its from 2010. The member by the name of merenda showed instructions on how to do it from the command prompt via ssh. Do her instructions still apply in 2019? If yes I can write a bash script to do so. That would be way faster. :)

Regards,
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello @captlid,

The manual modification of the files in /var/cpanel/userdata/ is unsupported. While the cPanel API 2 function may take longer, it's the best way to ensure the appropriate configuration files are populated with the correct information.

You can still use a bash script with a cPanel API 2 function. For instance, here's an example cPanel API 2 command:

Code:
cpapi2 --user=username Park park domain=example.com topdomain=subdomain
Thank you.