A subdomain is an extension of a domain name that precedes the root domain, separated by a dot. For example, in blog.example.com, blog is the subdomain. Subdomains can point to different servers, run different applications and be managed independently in DNS.
Common Subdomain Uses
www— Traditional web prefix for the main websiteblog— Separate blog platformshop— E-commerce store (often on a different platform like Shopify)app— Web applicationmail— Mail serverapi— API endpointstagingordev— Test environmentscdn— Content delivery network assets
Creating a Subdomain
Add an A record (or CNAME) in your DNS settings:
blog.example.com IN A 192.0.2.10
shop.example.com IN CNAME example.myshopify.com
Subdomain vs Subdirectory for SEO
This is a common SEO debate:
- Subdirectory (
example.com/blog) — Consolidates all link equity under one domain. Simpler for smaller sites. - Subdomain (
blog.example.com) — Treated as a separate entity by Google. Can be on separate servers. Better when the section is technically independent.
Google says it treats subdomains and subdirectories equivalently, but many SEO practitioners prefer subdirectories for blog content.
SSL and Subdomains
A standard SSL certificate covers only the root domain and www. A wildcard certificate (*.example.com) covers all first-level subdomains.