A subdomain is a free extension of a domain you already own, such as blog.yourdomain.co.ke or shop.yourdomain.co.ke. It does not need a separate registration and can point to its own folder, run its own application, or even host a completely different website design from your main site. You can set one up from your hosting control panel in a few minutes.
In cPanel
- Log in to your cPanel account.
- Under the Domains section, click Subdomains.
- In the Subdomain field, type the name you want (for example, blog).
- Choose the correct root domain from the dropdown if you have more than one domain on the account.
- Check the Document Root field. cPanel fills this in automatically, usually as a new folder inside public_html. You can change it if you want the subdomain to use a different folder.
- Click Create.
Your subdomain is now active and listed on the same page, where you can edit its document root or remove it later.
In DirectAdmin
- Log in to your DirectAdmin account.
- Go to Domain Setup and click on the domain you want to add the subdomain to.
- Find the Subdomain Management section and enter the subdomain name in the field provided.
- Click Create.
- DirectAdmin creates a matching folder for the subdomain inside your domain's public_html directory, named after the subdomain.
You can rename or delete the subdomain from the same Subdomain Management screen at any time.
Uploading content to your new subdomain
Once the subdomain exists, upload your site files to its document root folder using the File Manager or FTP, the same way you would for your main domain. If you plan to run WordPress or another app on it, you can usually install it directly into that folder using Softaculous.
Deleting a subdomain removes the subdomain record itself, but the files in its folder usually stay on the server. Check the folder afterward if you want to free up disk space.
What if the subdomain needs to point somewhere else?
A subdomain created this way automatically works on your existing hosting account with no extra DNS setup needed. But if you want the subdomain to point to a different server or an external service instead (for example, a helpdesk or email marketing tool hosted elsewhere), you will need to edit its DNS record, usually a CNAME or A record, rather than relying on the document root setting above.
Changes to DNS records can take a few hours to fully propagate, even though the subdomain itself is created instantly on your hosting account.
If you are trying to decide between a subdomain and a completely separate domain for a new section of your business, see how to add an addon domain instead.