Setting Up Subdomains
Create addresses like blog.example.com or shop.example.com, point them to the right place, and keep them secure with HTTPS.
blog CNAME blogs.example-service.com. shop CNAME shops.example-store.com. help A 203.0.113.25
🧰 What you need first
- A domain already connected to DNS you can edit
🎯 What you'll learn
- Understand what a subdomain is
- Point a subdomain to a host or service
- Make sure it works with HTTPS
🛠 Tools needed
- Your DNS provider account
- Your host or service account
One domain, many addresses
A subdomain is an extra name in front of your domain, like blog.example.com or shop.example.com. You don't buy it; it comes free with your domain. Each one can point somewhere different.
- shop. for an online store service
- help. for a help center
- staging. for a test copy of your site
Note: www is a subdomain too. That's why it needs its own record.
Set it up where it will live
If the subdomain is on your own hosting, create it in your control panel first (look for Domains or Subdomains). If it's for an outside service, find its "custom domain" setting. Either one tells you what DNS record to add.
Add the DNS record
- Open your DNS settings where your nameservers point.
- Add a record. In Host, type only the first part, like
blog, not the full address. - Pick the type your host or service asked for: CNAME to another name, or A to an IP address.
- Paste the value and save.
blog CNAME your-service-address.com.
Warning: a name can't have a CNAME and other records at the same time. If blog already has an A record, delete it first.
Turn on HTTPS
Each subdomain needs an SSL certificate. Most hosts and services create one automatically once DNS points to them. If yours doesn't, look for an SSL or HTTPS setting and request one.
Tip: check the result with our SSL Checker tool to confirm the certificate covers the subdomain.
Common problems
The subdomain shows my main site
Why: Your host received the visit but doesn't know about the subdomain.
Fix: Add the subdomain in your hosting control panel.
"Not secure" warning on the subdomain
Why: The certificate only covers your main domain.
Fix: Request SSL for the subdomain, or ask your host about a wildcard certificate.
Key takeaways
Keep going
- Moving registrars later? Read Moving a Domain to a New Registrar Safely
Enjoyed this guide?
Support free learning at mC0de.
