A subdomain is the part of a domain that goes before the main name: blog.example.com, shop.example.com, api.example.com. A single hosting account can have an unlimited number of subdomains, and each can point to its own folder, its own CMS, or even a separate application. Technically a subdomain is not a separate server or a separate hosting account, just another entry point into the same resource pool, so creating and deleting subdomains is not billed separately and does not require buying a new plan.
Creating a subdomain
- cPanel → Domains → Subdomains
- In the Subdomain field, enter a name (for example,
blog) - Pick the main domain from the list
- The Document Root field fills in automatically (
blog) — you can change it - Click Create
What happens on creation
- The folder
public_html/blogis created automatically - An A record
blog.example.com → server IPis added to DNS - Nginx/Apache starts serving the subdomain
File structure
public_html/
├── index.php ← main site (example.com)
└── blog/
└── index.php ← subdomain (blog.example.com)
Typical error during creation
If a subdomain with the same name existed before and was recently removed, cPanel sometimes refuses to create it with this message:
Sorry, the subdomain blog.example.com is already configured for another
account or has a conflicting DNS zone entry.
The cause is usually a leftover DNS record in the domain zone after the subdomain was deleted outside the standard flow (for example, edited manually through Zone Editor and never synced). The fix is to open cPanel → Zone Editor, find and delete the old A record or CNAME named blog, then recreate the subdomain through the regular form.
SSL for the subdomain
- cPanel → Security → SSL/TLS → Let's Encrypt
- Check the subdomain in the list
- Click Install Certificate
Let's Encrypt in cPanel usually issues a separate certificate for each subdomain on first request, but if you have many subdomains and create them often, it makes more sense to order a wildcard certificate *.example.com once — then new subdomains get HTTPS automatically without a separate request.
Wildcard subdomains
# cPanel → Domains → Subdomains
# In the "Subdomain" field, enter an asterisk:
*
# The DNS record will be created as:
*.example.com. A server_IP
A wildcard subdomain catches any name before the dot that has no dedicated record — anything.example.com points to the same folder. This is convenient for SaaS products where every customer gets their own subdomain (client1.example.com, client2.example.com) and the application itself determines the customer from the hostname in the request header.
An important detail: a Let's Encrypt wildcard certificate is only issued through DNS-01 validation, not the regular HTTP validation AutoSSL uses for individual subdomains. This means cPanel must prove domain ownership by adding a temporary TXT record to the DNS zone — if the domain is delegated to an external DNS provider with no API integration with the hosting, the wildcard certificate has to be issued manually through a third-party ACME client.
Popular uses for subdomains
| Subdomain | Use |
|---|---|
| blog.site.com | WordPress blog |
| shop.site.com | Online store |
| api.site.com | REST API backend |
| dev.site.com | Test environment |
| mail.site.com | Webmail interface |
When not to use a subdomain
- You need the fastest possible search visibility for a section — Google indexes a new subdomain as a partially separate site, and the main domain's accumulated authority does not transfer to it in full
- Applications on different subdomains need to share a cookie session — by default a cookie set for
example.comis not visible onblog.example.com, you must explicitly setdomain=.example.comwhen writing the cookie - Account resources are limited by the plan — all subdomains on shared hosting share the same CPU and memory pool (LVE) with the main domain, a subdomain gets no separate quota
- A subfolder is simpler and clearer — if the section does not need its own SSL or CMS, a subfolder like
example.com/blogavoids an extra DNS record and cookie confusion
Verifying the result
dig blog.example.com +short
# Expect the server's IP address in the response
curl -I https://blog.example.com/
# Expect: HTTP/1.1 200 OK or 301, but not connection refused
One more detail worth knowing: deleting a subdomain through cPanel → Subdomains does NOT delete its files folder by default — only the DNS record and the domain-to-directory link disappear, while the files keep using up the account quota until removed manually through File Manager. A subdomain propagates through DNS anywhere from a few minutes to 24 hours depending on the record's TTL. If it does not work right away, wait or flush your local DNS cache with ipconfig /flushdns (Windows) or sudo systemd-resolve --flush-caches (Linux). More on DNS records and Zone Editor is in the article how to add a domain in cPanel.