Subdomains explained: what they are and how to use them
blog.example.com, app.example.com, shop.example.com — subdomains let one domain host many things. Here's how they work and when to use one.
A subdomain is a prefix on your domain that can point somewhere entirely different: blog.example.com, app.example.com, shop.example.com. One domain, many destinations. They're free to create, and they're one of the most useful tools in DNS. Here's how they work.
Anatomy of a domain
Read a domain right to left:
blog . example . com
| | |
| | └─ TLD (top-level domain)
| └───────── second-level domain (the part you registered)
└────────────────── subdomain
The www in www.example.com is itself just a subdomain — by far the most common one. There's nothing special about it beyond convention.
What subdomains are for
Because each subdomain can point to its own IP or service, they let you split one domain across multiple purposes:
blog.example.com→ a blogging platformapp.example.com→ your web application on a VPSshop.example.com→ a hosted e-commerce serviceapi.example.com→ your backend APIstaging.example.com→ a test copy of your site
Each can live on a different server entirely, while sharing one memorable brand.
How to create one
Creating a subdomain is just adding a DNS record with the subdomain as the name. To point app.example.com at a server:
Type: A
Name: app
Value: 203.0.113.20
TTL: 3600
Or to alias a subdomain onto a hosted service, use a CNAME:
Type: CNAME
Name: shop
Value: shops.some-provider.com
TTL: 3600
That's the whole process — no separate registration, no extra fee.
Subdomain vs subfolder
A common question: should new content live at blog.example.com (subdomain) or example.com/blog (subfolder)?
- Subdomain — best when the content is technically separate: a different app, a different server, a different platform. Each subdomain can be hosted independently.
- Subfolder — best when it's part of the same site on the same server, and you want it to share the main domain's authority and setup.
For a blog on the same server as your main site, a subfolder is often simpler. For a separate app or a service hosted elsewhere, a subdomain is the natural fit.
Wildcard subdomains
If you're building something like a SaaS where every customer gets customer.example.com, you don't want to add a record per customer by hand. A wildcard record catches them all:
Type: A
Name: *
Value: 203.0.113.30
TTL: 3600
Now any subdomain that doesn't have its own record resolves to that server, which then figures out which customer is which from the hostname.
HTTPS for subdomains
Each hostname needs its own certificate coverage. Let's Encrypt can issue a certificate covering multiple names at once:
sudo certbot --nginx -d example.com -d app.example.com -d blog.example.com
For a wildcard, Let's Encrypt supports *.example.com certificates via a DNS challenge.
The practical takeaway
Subdomains are free, instant, and endlessly useful for organising projects under one brand. Point each one wherever it needs to go with a single DNS record. In Nxeon's DNS panel you can add as many as you like — a subdomain for your app on one server, another for staging, all under the domain you already own.