Subdomain

Domain Fundamentals
A domain that is part of a larger domain, created by adding a prefix to the main domain name.
← Back to Glossary

What is a Subdomain?

A subdomain is a domain that exists as part of a larger parent domain, created by adding a prefix to the main domain name. In "blog.example.com," "blog" is the subdomain of "example.com." Subdomains allow website owners to organize content, host separate applications, or create distinct sections without registering additional domain names. They're created through DNS configuration at no extra registration cost.

Subdomain Structure

blog.example.com

│ │ │

│ │ └── TLD (Top-Level Domain)

│ └── Root domain (Second-Level Domain)

└── Subdomain (Third-Level Domain)

Multiple levels possible:

dev.api.example.com

│ │ │

│ │ └── Root domain

│ └── First subdomain

└── Second subdomain (fourth level)

Common Subdomain Uses

SubdomainTypical Purpose
wwwMain website (traditional)
blogBlog or news section
shop/storeE-commerce platform
appWeb application
apiAPI endpoints
mailWebmail access
dev/stagingDevelopment environments
support/helpCustomer support portal
cdnContent delivery
m/mobileMobile-optimized site

Creating Subdomains

DNS Configuration

Add records for the subdomain in your DNS zone:

; A record pointing to IP

blog.example.com. A 192.0.2.10

; CNAME pointing to another domain

shop.example.com. CNAME mystore.shopify.com.

; Multiple subdomains

api.example.com. A 192.0.2.20

dev.example.com. A 192.0.2.30

Wildcard Subdomains

Match all undefined subdomains:

*.example.com.    A    192.0.2.100

Subdomain vs Subdirectory

AspectSubdomainSubdirectory
URLblog.example.comexample.com/blog
DNS requiredYesNo
Separate hostingEasyComplex
SEO authoritySeparateShared
SSL certificateMay need wildcardCovered by main cert
AnalyticsSeparate propertySame property

When to Use Subdomains

When to Use Subdirectories

Subdomain SEO Considerations

Search Engine Treatment

Best Practices

1. Use subdomains for truly separate entities

2. Use subdirectories to consolidate SEO

3. Implement proper canonicalization

4. Set up separate analytics tracking

5. Create XML sitemaps for each subdomain

Security Considerations

SSL Certificates

Certificate TypeCoverage
Single domainexample.com only
Wildcard*.example.com (one level)
Multi-domain SANSpecific listed domains

Cookie Scope

Set-Cookie: session=abc; Domain=.example.com

# Accessible to all subdomains

Set-Cookie: session=abc; Domain=blog.example.com

# Only accessible to blog subdomain

Subdomains provide flexible organization for websites and applications, allowing distinct sections to operate independently while remaining part of the parent domain's namespace.

Put This Knowledge to Work

Use DomScan's API to check domain availability, health, and more.