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 kill pid vzctl or vzquota in OpenVZ containers

To fix this issue , [ vzquota : (error) can't lock quota file, some quota operations are...

There were 73408 Failed Login Attempts Since the last successful login

I saw the below on my Linux Server. "There were 73408 failed login attempts since the last...

Uninstall/Remove Litespeed forever from Cpanel/WHM

Hi,If you want to remove Litespeed from the cpanel/WHM server, You need to run the following...

Error while adding an Addon domain in cPanel (sorry the domain is already pointed to an IP address)

cPanel/WHM is an easily managing control panel for web hosting. You can create accounts for...

How to install cloudflare into cpanel/WHM

How to install cloudflare into cpanel/WHMYou need to run this command over ssh: bash <(curl...