Can not create domain – Domain already exists

Hello Friends,

Most of us might encountered this problem while adding a sub-domain or add-on domain in the server. You would want to check the following locations:
~~~~
/var/cpanel/userdata/username/main
/var/cpanel/userdata/username/sub.maindomain.com
/var/cpanel/users/username
/var/named/maindomain.com.db
~~~~

Probably you may prefer the commands to do this for you:
~~~~
]# grep domain.com /var/cpanel/users/*
]# grep -R domain.com /var/cpanel/userdata/*
~~~~

Any of the above if it has traces of the subdomain will cause the subdomain to continue to be considered existing on the system. Simply make a copy of the file you are editing and then remove the subdomain.

For the /var/cpanel/userdata/username/sub.maindomain.com file, simply move the file out of the way.

For the /var/named/maindomain.com.db file, you could edit it in WHM > Edit a DNS zone if the sub-domain is still there rather than edit that file directly. Even if you are editing the /var/named/maindomain.com.db (in the case of subdomain) or /var/named/add-on-domain.com.db (in the case of Add-on Domain) via SSH, you need to run the command below to refresh the Zone files in your server.
~~~~
]# rndc reload
~~~~

Once you are done with the removing the traces of the sub-domain or add-on domain from your server by following the steps mentioned above, you may need to run the following commands to make sure that your changes are saved.
~~~~
You need to rebuild your Apache configuration.
]# cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf_bak
]# /scripts/rebuildhttpdconf
]# /etc/init.d/httpd restart

You need to update your user domains list file “/etc/userdomains”.
]# /scripts/updateuserdomains
~~~~

Now you should not face any problems with adding the sub-domain or add-on domains from your cPanel.

I wish you all a very Good Life Friends!!! Have Fun!!!!! 🙂 😉

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s