How to Prevent cPanel Users from Creating Certain Domains
To add to the list of domains that WHM denies to users, perform the following steps:
-
From the command line, run the
cat /usr/local/cpanel/etc/commondomainscommand to view the default list of domains that WHM does not allow users to create.-
If the file contains a large number of entries, run the
grep 'domain' /usr/local/cpanel/etc/commondomainscommand to determine whether thedomaindomain exists in the list.Warning:
Do not edit this file directly. System updates overwrite any changes to this file. Instead, follow the next step to create a new file.
-
- With a text editor, add the domains that you do not want WHM to create to the
/var/cpanel/commondomainsfile.
-
Add each domain on a separate line, and do not prepend or append a dot to each domain name. For example:
1234a.comb.comc.comd.com -
Only add domain names to this file (for example,
example.com). When you list a domain name, WHM will automatically prevent the creation of subdomains for that domain. For example, if you list theexample.comdomain, users also cannot create thesub.example.comdomain.
-
- In the Domains section of WHM's Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings), set the Prevent cPanel users from creating specific domains setting to On.
