A subdomain is an additional section of your main domain. If, for instance, you want to set up a blog that is separate from your main site then you can create a subdomain such as blog.example.net. This article explains how to create and manage subdomains in cPanel, and also covers some common issues / misconceptions.
cPanel’s Subdomains interface has two parts:
To create a subdomain you typically only need to enter the name of the subdomain, as shown in the below screenshot.
Image: creating the subdomain blog.example.net.
Here, we created the subdomain blog, which belongs to the domain example.net. The Document Root field defines where the website files for the subdomain are stored. cPanel automatically suggests a directory based on the name of the subdirectory (public_html/blog, in our case). You can change the document root to another folder in the public_html directory. In most cases, though, you can simply hit the Create button.
Existing subdomains are listed under the header Modify a Subdomain.
Image: the list with existing subdomains.
There are two subdomains in the above screenshot. The first is the subdomain we just created (blog.example.net). The other subdomain, example.example.net, is linked to an addon domain. In cPanel, each addon domain has a subdomain. If you see a subdomain you don’t recognise, it is likely to be an addon domain on your account.
For each domain you got the following options:
Search engines such as Google see subdomains as independent domains. As far as search engines are concerned example.net and blog.example.net are unrelated websites. This can be a disadvantage. For instance, if you get lots of traffic to blog.example.net then that doesn’t benefit the ranking of the domain example.net, and vice versa.
As a rule of thumb, it is best to only use a subdomain for a section of a website that should be completely separate. One good use-case is a development site. For instance, you could use a domain like dev.example.net if you are working on a brand new website.
Removing a subdomain doesn’t remove website files and databases. Instead, cPanel changes the DNS so that the subdomain no longer resolves. The subdomain’s A record, for instance, will be deleted.
Even though the website files aren’t touched we do recommend making a backup of your account before you hit the Remove button.
It is worth noting that you can easily restore a subdomain that was deleted in error. Because the website files aren’t removed you can simply recreate the subdomain. Provided that the website files still exist you only need to make sure that the subdomain is pointing to the correct document root.
You can change the directory in which the website files for a subdomain are stored as follows: