Automatic subdomain for new customers?


Jan 1, 2018
cPanel Access Level
Root Administrator
Hi all.

I am the administrator of a server running the latest cpanel/whm versions on CentOS 6.9.

I have a subdomain - I wish to allocate all new clients upon signup.

This is in addition to any domains they are bringing with them.

Is there a way I can do this?

I am resisting using mod_dir for security reasons. is owned by another user on the system, so if this presents a problem I am happy to use

Thanks in advance for any help.


Staff member
Apr 11, 2011

Is this for the purpose of providing them with a temporary URL to access their websites? If so, you could setup a custom bash script that uses the cPanel API 2 "Park" function, and then configure that script to run automatically during the account creation process using a post "Accounts::Create" hook to automatically set up the alias (parked domain) upon account creation. Here are some documents to help you get started should you want to set this up:

Guide to Standardized Hooks - Software Development Kit - cPanel Documentation
Guide to Standardized Hooks - Whostmgr Functions - Software Development Kit - cPanel Documentation
cPanel API 2 Functions - Park::park - Software Development Kit - cPanel Documentation

Another option is to simply offer instructions to end-users regarding the use of the hosts file on their computers to temporarily access their domain names before they resolve to the cPanel server:

How to Modify your hosts File - cPanel Knowledge Base - cPanel Documentation

Thank you.