How to Create an Add-on Domain in cPanel

What is Addon domain.

The Addon domains allow you to control multiple domains from your single account. An addon domain links as a new domain name to a sub directory of your account’s public_html (document root) directory, and then stores its files in that sub directory. This means that you can host additional domains in your account.

You can give an addon domain email addresses, forwarders, and more the same way as a primary (main) domain on the account.

Create an addon domain.

To create an addon domain, perform the following steps:

Login to cPanel, under DOMAINS section, click on Addon Domains

Enter the new addon domain’s name in the New Domain Name text box.

Create Addon Domain

Enter the directory that you wish to contain the addon domain’s files in the document root text box.

Note:- When you enter the domain name, cPanel automatically populates the Subdomain or FTP Username text box. To create multiple addon domains with the same username and different extensions (such as addon.com and addon.net), manually enter a unique username in the Subdomain or FTP Username text box.

Create Addon Domain

Click on Password Generator, select I have copied this password in a safe place, Click on Use Password. 

And Click on Add Domain.

Now that your addon domain name has been added to your cPanel you can go to that folder and upload your web site files. Once the propagation takes place your web site files and emails for your addon domain name will be live on the internet.

How to fix cPanel Domain already exists Error

Domain
Domain

You get this error sometimes, when you are hosted using the cPanel

I parked yourdomain.com which redirects automatically to yourdomain.org.

I deleted the domain from Parked Domains panel, and added it back via the Addon Domains panel.

Then the error “Already Exists”, even though it was not listed in the Addon Domains nor was it listed in the Parked Domains.

This is due to the domain name existing anywhere in the cPanel configuration and need to get removed / deleted.

Check whether zone exists or not

dig @server_ip yourdomain.com

If the zone file exists, it will show the A record of yourdomain.com.

If zone file exists, log into the server and make sure the domain doesn’t exist

 /scripts/whoowns yourdomain.com

If it does, you need to remove prior adding  the Addon domain.

Remove the zone file from the server

/scripts/killdns yourdomain.com

Now you have removed DNS zone and help you add the addon or parked domain.

There are old traces of the domain on the server

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 yourdomain.com

 Check cPanel files

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

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

Edit file/s that are found and remove domain name the customer is trying to add.

You also may need to remove the all the files related to domain name.

/var/cpanel/userdata/USERNAME/ directory

Rebuild user domains database

/scripts/updateuserdomains

Rebuild Apache to make sure all  entires of bad domain removed.

/scripts/rebuildhttpdconf

service httpd restart

This should have all entries left behind from when this domain name was removed in the past no longer conflict, when you try to add the domain again.