Fix Domain already exists error – cPanel

 The Problem:

This is a  very common error  when adding an addon or parked domain via cPanel. Unfortunately, the error they see is usually very generic and doesn’t provide any information such as “can not create domain”. This is usually due to the domain name existing *somewhere* and checking these locations/steps out should help you find the domain that is lurking somewhere and causing the issues.

Reason 1: There is an existing zone file on the server.

1) You can use the following command to check whether zone exists or not,

# dig @server_ip domain.com

If there is a zone file exists, this will show the A record of the domain.com.

2) If there is a zone file that exists, log into the server that the zone file is pointing to and make sure the domain doesn’t exist:

# /scripts/whoowns domain.com

If it does, you would need to remove this prior to adding their new addon domain. If it does not, continue on

3) Remove the zone file from master by running the following command:

# /scripts/killdns domain.com

This will then get rid of the pesky zone file that is getting in the way of their addon creation.

Reason 2: There are old traces of the domain on the server

1) Log into the server where the customer is seeing problems adding the domain and confirm that the domain does not exist on the server.

# /scripts/whoowns domain.com

2) Check cPanel files for traces of the problem domain name

# grep domain.com /var/cpanel/users/*

# grep -R domain.com /var/cpanel/userdata/*

3) Edit any files that are found and remove the traces of the domain name the customer is trying to add. You can remove the lines that contain the mentioned domain. You also may need to remove the entire file for the domain in the /var/cpanel/userdata/USERNAME/ directory.

4) Rebuild the user domains database

# /scripts/updateuserdomains

5) Rebuild the Apache configuration and make sure apache is running with all traces of the bad domain removed.

# /scripts/rebuildhttpdconf ; service httpd restart

This should have all traces that were left behind from when this domain name was removed in the past and then will no longer cause a conflict when the customer tries to add the domain again.

That’s it..:)

Was this answer helpful?

Also Read

How to Enable Second Level Quotas in OpenVZ

To do this, you will need to have a VM already set up. Once you have this, you will need to be...

X3host Now supports Let's Encrypt Free SSL Certificates !

Many of our clients needed this addon " We always listen to our clients " SO we have decided to...

Installation of kloxo Control Panel on CentOS 5/6 x86Bit

Hello,Today we will learn how to install kloxo control panel on the CentOS 5.8 Final x86bit...

How install Resource Monitor in cPanel Servers

Installation Instructions Step 1: Download the RSMonitor file located at...

How to disable cPanel redirection to SSL?

There are times you want to disable automatic to SSL connection while accessing WHM, cPanel,...