What Is a Subdomain?
A subdomain is a DNS label placed before a registered domain. In blog.example.com, example.com is the domain and blog is the subdomain. The label can route visitors to a different host, application, or server while still keeping the familiar main name. That is why subdomains are common for docs, stores, apps, and portfolios.

How is a subdomain different from a domain?
A domain is the name registered through a registrar, such as example.com. A subdomain is configured under that name by the domain owner. Registration, price, and ownership therefore belong to the domain; DNS routing and organization are the usual reasons to add a subdomain.
| Comparison | Domain | Subdomain |
|---|---|---|
| Example | example.com | docs.example.com |
| Registration | 1 registrar record | 0 extra registrations |
| DNS target | 1 primary zone | 1 or more records |
| Typical use | Brand or main site | App, docs, portfolio |
When should you use a subdomain?
Use a subdomain when the destination needs a distinct technical boundary or a clear visitor purpose. It is not mandatory for every page. A normal page path, such as example.com/pricing, is often simpler when the content belongs to the same site and deployment.
- A portfolio on a separate hosting platform.
- Documentation maintained by another deployment.
- An app, API, or status page with its own routing.
- A simple HTTPS redirect for a short public link.
How does a subdomain work in DNS?
DNS resolves the requested name by looking up records in the domain zone. A CNAME sends the subdomain to another compatible hostname; an A record maps it to a public IPv4 address. The record type must match the target supplied by your host. Cloudflare explains these record types in its official DNS documentation.
Read Cloudflare’s DNS record reference.
Frequently asked questions
Is a subdomain a separate domain?
No. It is a label under a registered domain and is controlled through that domain’s DNS settings.
Do I need a subdomain for every page?
No. Use a path for regular pages. Use a subdomain when an app, service, or host needs a separate address.
Can it point to another host?
Yes. A CNAME can point to a compatible host name, while an A record points to a public IPv4 address.
Continue learning
Want to use a subdomain?
Claim a free, no ads address for a legitimate project.