How to prevent users from creating certain domains?

The control panel WHM & cPanel allows you to prevent cPanel users from creating certain domains. Which means, to prevent users to create well-known common domains as PARKED or ADDON to the existing account. It’s a serious issue by considering the Spamming or other related suspicious activities which are usual in shared hosting accounts.

Consider one case, if you have a shared hosting account and one of your cPanel user may be using his account to send Spam emails or for other malicious activities from his parked or addon domain with the actual account. In this case, you must have an idea to prevent this from well-known and common domains such as facebook.com, google.com, gmail.com etc. You can prevent this from the Tweak settings of your WHM control panel.

By-default the WHM/cPanel blocks a list of domains, to see the domains WHM already blocks, view the file /usr/local/cpanel/etc/commondomains.

Example:

root@server [~]# cat /usr/local/cpanel/etc/commondomains
google.com
gmail.com
hotmail.com
aol.com
yahoo.com
excite.com
cs.com
juno.com
mail.com
email.com
address.com
altavista.net
netscape.net
netscape.com
earthlink.net
attracta.com

Steps to prevent user’s from creating certain domains

Step I : SSH to server as root.
Step II : Create the file /var/cpanel/commondomains.
In /var/cpanel/commondomains, list the domains you wish to prevent cPanel users from creating.
You must separate domains with a newline.

Important: You should only list domain names in /usr/local/cpanel/etc/commondomains(e.g. example.com). Listing a domain name will automatically prevent the creation of subdomains for the specified domain. For example, listing example.com will prevent users from creating sub.example.com. In addition, domains listed in this file should not contain a leading dot.

Step III : Make sure that, on the Tweak Settings screen, Prevent cPanel users from creating specific domains is turned ON.

See the attached image for more clarification.

Capture

 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to create a cPanel user account?

To create a new cPanel account go to WHM >> Account Functions >> Create a New...

How can I limit the number of emails a domain can send out per hour?

Click on the "Tweak Settings" link under "Server Setup". Within the "Mail" section is a text box...

How can I limit access to certain directories on my server by requiring a password using cPanel/WHM?

In cPanel, it is very simple to limit access to a directory on your server. This can be used to...

How do I prevent SSL Certificate Warnings when accessing cPanel?

All cPanel servers come with self-signed certificates configured to secure the control panel as a...

How do I create a MySQL database and user in cPanel/WHM? How do I connect them?

To create a MySQL database and user, log into the cPanel interface for the desired domain and...

Powered by WHMCompleteSolution