Getting error ‘The domain already exists in the Apache configuration’ when adding an add-on or parked domain via cPanel

This might occurs when domain name never shows up under Add-on Domains in cPanel but actually it does exists anywhere in the cPanel configuration. Following is the way defined below, to remove any trace of the domain from cPanel configuration manually.

1.) Firstly you need to verify if the domain is owned by any particular user by following command,


/scripts/whoowns owner


#grep /etc/userdomains owner


2.) Now you need to check if the zone file for the domain exists.


# ls -ld /var/named/

If there exists a zone file for the domain, then remove the zone by executing the following command:


# /scripts/killdns



3.) Now check cPanel user files, to see if there exists any traces of the domain:


# grep /var/cpanel/users/*


# grep -R /var/cpanel/userdata/*


Binary file /var/cpanel/userdata/owner/main.cache matches


/var/cpanel/userdata/owner/main /var/cpanel/userdata/owner/main:


Edit any files that are found and remove the entire line that contains the domain name. Once you’ve done this, there shouldn’t be any entry for in the cPanel configuration file.

4.) Rebuild the User domain database:



Rebuild the Apache configuration




5.) Now, restart the Web Server as the configuration file is altered.

If the server is running on apache

# service httpd restart


If the server is running on LiteSpeed:

# service lsws restart



Once all these steps are done, you should be able to add as an Add-on domain under the account ‘owner’.


Was this answer helpful? 36 Users Found This Useful (39 Votes)