How to Fix cPanel Error: Sorry the Domain is Already Set Up

If you get the error “Sorry, the domain is already set up” on your cPanel account, it’s usually because of two things. This issue indicates that the domain in question is still present in the virtual host section of the Apache httpd.conf configuration file. We’ll go over the two most common reasons you’re getting this error notice and the actions to fix it in the following guide.

cPanel Troubleshooting

There are two probable reasons why you are encountering this error:

  • Explanation One – The first possibility is that the domain you’re trying to create is already used by another account as a primary, addon, or parked domain.
  • Explanation Two – It’s also possible that you’re having problems with the domain’s technical aspects. It’s likely that if the domain was previously associated with another account and was removed using the deleting feature, it wasn’t totally deleted from the system.

If the problem is caused by the first reason, the domain name can be readily removed from the cPanel account. It should cause the following error even if it is not removed:

Fixing cPanel Error

Follow these procedures to address the problem:

To begin, determine who owns the domain. Enter the following command to do so:

/scripts/whoowns example.com

Note: That the “example.com” given above should be replaced with the name of the domain in concern.

Enter the following command string if the above command yields no results:

grep example.com /var/cpanel/users/*

The following is an example of what you’ll get as a result:

root@server [~]# grep example.com /var/cpanel/users/*

/var/cpanel/users/exam:XDNS1=example.com

The owner of the domain example.com is shown in this information. Now that you know whose account the domain is currently connected with, you may change the following files with the new user’s information and delete the lines associated with the old domain.

/var/named/example.com.db

Remove the virtualhost for example.com from /etc/httpd/conf/httpd.conf

/var/cpanel/users/username [remove entries related to the domain]
/etc/userdomains
/etc/localdomains
vim /etc/named.conf [remove entries related to domain]

Remove DNS entry in WHM
Run /scripts/updateuserdomains as root on the server.

That’s all there is to it!