Subdomain
A prefix to a domain name (such as 'blog' in 'blog.example.com') that identifies a separate section of a website or a distinct service.
Also known as: sub domain, subdomain name
A subdomain is a prefix added to a domain name to identify a distinct section of a website or a separate service operating under the same parent domain. In blog.example.com, “blog” is the subdomain of example.com.
Subdomains are configured through DNS and can point to the same server as the main domain, a different server, or a third-party service.
How subdomains work
Each subdomain is configured by adding a DNS record (typically an A record or CNAME) at the registrar or DNS provider. For example:
example.com→ server A (the main site)www.example.com→ server A (often a CNAME or A record matching the root)blog.example.com→ server B (perhaps a different platform or hosting provider)app.example.com→ server C (a web application)mail.example.com→ mail serverapi.example.com→ API server
The subdomains share the parent domain registration but can route independently.
Common subdomain conventions
| Subdomain | Typical use |
|---|---|
www | Historic prefix for the main website; modern sites often redirect www to the root or vice versa |
blog | Blog or articles section, especially when hosted on a different platform |
shop | Ecommerce store |
app | Web application separate from the marketing site |
api | API endpoints |
docs | Documentation site |
help or support | Help center or knowledge base |
mail | Mail server |
ftp | (Historical) FTP server |
cdn or static | Asset delivery, often pointed at a CDN |
staging or dev | Staging or development environments |
These are conventions, not requirements; subdomains can be named anything.
Subdomains vs subdirectories
Two common ways to organize a website’s sections:
| Approach | Example | Configuration |
|---|---|---|
| Subdomain | blog.example.com | DNS record per subdomain; can point to different infrastructure |
| Subdirectory | example.com/blog | Routing within a single site |
Subdomain advantages
- Different sections can run on different platforms (marketing site on Webflow, blog on WordPress, app on a custom stack)
- Hosting can be split for performance or organizational reasons
- Different teams can manage different subdomains independently
- Failures in one section do not affect others
Subdirectory advantages
- All content shares the same domain authority for SEO purposes (subdomains are sometimes treated as separate sites by search engines)
- Single hosting environment to manage
- Easier internal linking and consistent navigation
- Fewer DNS changes during structural reorganization
The SEO implications of subdomains vs subdirectories have been debated; current consensus is that Google treats subdomains as part of the same site in most cases, but the historical preference for subdirectories persists.
Wildcard subdomains
A wildcard DNS record (e.g., *.example.com) routes all subdomains not explicitly configured to a default server. This is common for:
- Multi-tenant applications where each customer gets their own subdomain (e.g.,
customer1.example.com,customer2.example.com) - Catching typos or bot traffic
- Dynamic subdomain creation in development environments
Wildcard subdomains require a wildcard SSL certificate to serve HTTPS for arbitrary subdomain names.
Subdomains and SSL certificates
By default, an SSL certificate covers a specific domain or list of domains. Common patterns:
- Single-domain certificate. Covers
example.comonly - www included. Covers
example.comandwww.example.com(very common pattern) - Wildcard certificate. Covers
*.example.com(any single subdomain) - Multi-domain (SAN) certificate. Covers a specified list of subdomains
Modern automated SSL (Let’s Encrypt) makes per-subdomain certificates straightforward, but wildcard certificates are useful for sites with many or dynamically created subdomains.
Sub-subdomains
Subdomains can be nested: dev.app.example.com has app.example.com as the parent and dev as the prefix. This is allowed but uncommon outside of large organizations or specific deployment patterns.
Common misconceptions
- “www is required.” The
wwwsubdomain was historically conventional but is not required. Many modern sites use the root domain (example.com) as their primary address and redirectwwwto it, or vice versa. Either approach is fine; consistency matters. - “Subdomains are subsites.” Search engines typically treat subdomains of the same root domain as related, especially when ownership is clear.
- “Setting up a subdomain requires a developer.” Adding a DNS record at most registrars or DNS providers takes minutes through a web interface.