Subdomains are extensions of a domain. They function separately from the main domain, thus they can be used to host additional websites. The format of a subdomain is: subdomain.domain.com.
Let’s say we have a domain mywebsite.com and we want to create a forum and a blog for the main site. We could locate them on forum.mywebsite.com and blog.mywebsite.com. These subdomains can also be accessed via mywebsite.com/forum and mywebsite.com/blog. In this tutorial, you will learn how to create and manage a subdomain in cPanel.
What you’ll need
Before you begin this guide you’ll need the following:
- A functional domain correctly pointed to your hosting provider.
- Access to cPanel.
Step 1 — Navigating to cPanel-> Subdomains section.
Note: If you already have a subdomain, please skip to Step 3 — Uploading files to subdomain Document Root.
Step 2 — Creating a Subdomain
- Subdomain field represents the name of a subdomain. In this section, only the subdomain extension has to be entered.
- Domain field lets you choose the domain under which the subdomain will be created.
- Document Root is the root directory of a subdomain. This folder is created in public_html by default.
- After clicking Create, this message will appears on your screen.
If any errors or issues are encountered during this step, the hosting provider should be contacted for assistance.
Step 3 — Uploading files to subdomain Document Root
All files/scripts should be uploaded to the Document Root directory specified in Step 2. The directory is automatically created in public_html and can be easily accessed using File Manager section of cPanel. If a subdomain is created using an Addon Domain, the subdomain’s Document Root will be created inside the root directory of the addon domain, for example: public_html/addon_domain_root/subdomain_root.
Step 4 – Deleting a subdomain
If a subdomain is no longer required, or the name was enterred incorrectly, it is always possible to remove it. A subdomain can be deleted by pressing the Remove button in cPanel->Subdomains section.
IMPORTANT! The root directory and files of the subdomain will not be removed. A manual deletion will have to be performed by using the File Manager or any FTP client.
If the goal is to create a subdomain with a different name while displaying the same content, the best way would be to delete the old subdomain and create a new one with the same root directory as the deleted subdomain.
Optional – Changing DNS
Since subdomains function separately from the main domain, they can also use different DNS configuration. For example a subdomain can be used to create a Minecraft or Teamspeak server. DNS settings can be updated via cPanel -> Advanced Zone Editor or Simple Zone Editor
More information about these editors can be found in the official cPanel documentation
To sum up, subdomains are a fast, cheap and effective way to create additional websites, as there is no need to purchase additional domain names. They can also be used to set up specific areas for your main website, such as a forum, blog, shop etc.
- Subdomains are separately functioning domain extensions.
- Subdomain DNS configuration can be changed without affecting the main domain.