Subdomains are prefixes to your main domain (like blog.example.com). They can point to the same server, different servers, or third-party services.
Creating a Subdomain
There are two steps:
- Add DNS record for the subdomain
- Configure hosting to serve content (if hosting locally)
Method 1: Subdomain on Same Server
If hosting the subdomain on Ahosting:
- Go to cPanel > Domains
- Click Create A New Domain
- Enter full subdomain: blog.example.com
- Click Submit
cPanel automatically creates the DNS record and folder.
Method 2: Subdomain to Different IP
If pointing to a different server:
- Go to Zone Editor
- Click + A Record
- Name: blog (the subdomain prefix)
- Address: The destination IP address
- Click Add Record
Method 3: Subdomain to External Service
If pointing to a third-party service (Shopify, Tumblr, etc.):
- Go to Zone Editor
- Click + CNAME Record
- Name: shop (the subdomain prefix)
- Record: shops.myshopify.com (service hostname)
- Click Add Record
Common Subdomain Configurations
| Subdomain | Record Type | Points To |
|---|---|---|
| www | A or CNAME | Same server or example.com |
| blog | A | Same server IP |
| shop | CNAME | shops.myshopify.com |
| A | Mail server IP | |
| staging | A | Development server IP |
| app | A | Application server IP |
Wildcard Subdomain
A wildcard record handles all undefined subdomains:
*.example.com A 192.168.1.1
Any subdomain not specifically defined will use this record.
SSL for Subdomains
Each subdomain needs its own SSL certificate or a wildcard certificate.
- AutoSSL: Automatically covers subdomains added in cPanel
- Wildcard SSL: Covers *.example.com with one certificate
- External services: Usually provide their own SSL
Subdomain Email
You can create email addresses for subdomains:
MX records can be added for subdomains if needed.
Testing Subdomain Setup
- Wait for DNS propagation (few minutes to hours)
- Use nslookup or dig to verify record:
nslookup blog.example.com
- Try accessing in browser
Troubleshooting
Subdomain not resolving
- Check DNS record exists in Zone Editor
- Wait for propagation
- Verify no typos in subdomain name
Subdomain shows wrong content
- Verify document root is correct in cPanel
- Check A record points to correct IP
- Clear browser cache
SSL not working on subdomain
- Run AutoSSL from cPanel
- Wait for certificate issuance
- Check subdomain is added in cPanel Domains