WHAT'S NEW
Domains & DNS · GuideGuides › Domains & DNS

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.

📶 Beginner⏱ 7 min🗓 Updated November 17, 2026❤ 0
subdomains.txt
blog   CNAME  blogs.example-service.com.
shop   CNAME  shops.example-store.com.
help   A      203.0.113.25
// Before you start

🧰 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
01 / Start here

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.

02 / Step 1

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.

03 / Step 2

Add the DNS record

  1. Open your DNS settings where your nameservers point.
  2. Add a record. In Host, type only the first part, like blog, not the full address.
  3. Pick the type your host or service asked for: CNAME to another name, or A to an IP address.
  4. 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.

04 / Step 3

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.

05 / Help

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.

// Recap

Key takeaways

A subdomain is a name in front of your domain, like blog.example.com
It needs its own DNS record (A or CNAME)
Many hosts also need the subdomain added on their side
Each subdomain needs SSL too
// What's next

Keep going

Enjoyed this guide?

Support free learning at mC0de.

PIX0
</> {} JS 01
0101 </> CSS JS HTML PIX0 const {} 1010 async mC0de function return 0101 <div> 1010 PIX0 CSS JS HTML const {} 0101 mC0de
PIX0 // WORLD OF CODE
PIX0 IS PREPARING SOMETHING AWESOME FOR YOU 0%