What is a Subdomain? How to Create & Configure in DirectAdmin
Table of Contents
1. What is a Subdomain?
A subdomain is an extension added before your main domain name, separated by a dot (.). If your main domain is example.com, subdomains would look like:
blog.example.com— subdomain named "blog"shop.example.com— subdomain named "shop"api.example.com— subdomain named "api"mail.example.com— subdomain named "mail"
Technically, subdomains work through DNS Records — they point to an IP address or CNAME of a target server. This means each subdomain can reside on the same server as your main site or on a completely different one.
2. Benefits of Using Subdomains
- Separate website sections: Clearly divide blog, shop, app from your main site
- Independent team management: Each team manages their own subdomain autonomously
- Testing environments: Use dev.example.com or staging.example.com for testing before going live
- Multi-language sites: en.example.com, th.example.com for multilingual content
- Specialized services: Separate API, CDN, Email services from your main website
- Cost savings: No need to buy new domains — create unlimited subdomains from your existing domain for free
3. Common Subdomain Examples
| Subdomain | Purpose | Example URL |
|---|---|---|
www | Main website (most common) | www.example.com |
blog | Blog or articles section | blog.example.com |
shop / store | E-commerce store | shop.example.com |
api | API endpoint for developers | api.example.com |
mail | Webmail or email service | mail.example.com |
dev / staging | Development/testing environment | dev.example.com |
cdn | Content delivery for static files | cdn.example.com |
docs | Documentation portal | docs.example.com |
m | Mobile-specific website | m.example.com |
app | Web application | app.example.com |
4. Subdomain vs Subdirectory — Which Should You Choose?
This is one of the most frequently asked questions in web development. Here are the key differences:
| Aspect | Subdomain (blog.example.com) | Subdirectory (example.com/blog) |
|---|---|---|
| SEO | Google treats it as a separate site | Shares SEO authority with main domain |
| Management | Independent, decoupled | Same system as main site |
| Hosting | Can use different servers | Must be on same server |
| SSL | Needs separate cert or Wildcard | Uses same SSL as main domain |
| Best for | Separate apps, APIs, services, different tech stacks | Blog, portfolio, content marketing |
5. Creating a Subdomain in DirectAdmin
DirectAdmin makes creating subdomains quick and easy. Follow these steps:
Step 1: Log into DirectAdmin
Open your browser and navigate to https://your-domain.com:2222 or the URL provided by AsiaGB. Enter your Username and Password.
Step 2: Go to Domain Setup
From the Dashboard, click "Domain Setup" under Your Account section, or search for "Subdomain" in the navigation.
Step 3: Select Domain and Create Subdomain
- Click on your main domain name
- Click the "Subdomains" link
- In the "Create Subdomain" field, enter your subdomain name (e.g.,
blog) - Click the "Create" button
DirectAdmin will automatically create the subdomain, a DNS A record pointing to your server's IP, and a new folder at ~/domains/your-domain.com/public_html/blog.
Step 4: Upload Your Website Files
Upload your website files to the folder DirectAdmin created, or use the built-in File Manager in DirectAdmin to add your content.
6. DNS Records for Subdomains
DirectAdmin automatically manages DNS for subdomains created through its interface. However, if you need to manually configure DNS or point a subdomain to a different server:
A Record — Point Subdomain to an IP Address
Name: blog
Type: A
Value: 203.xxx.xxx.xxx (your server's IP address)
TTL: 3600
CNAME Record — Point Subdomain to Another Domain
Name: shop
Type: CNAME
Value: myshop.myshopify.com. (note the trailing dot)
TTL: 3600
Use CNAME records to point a subdomain to external services like Shopify, GitHub Pages, Netlify, or other cloud platforms.
Checking DNS Propagation
Use these commands to verify DNS propagation:
nslookup blog.example.com
# or
dig blog.example.com A
7. SSL Certificates for Subdomains
Every website — including subdomains — should have SSL. There are two main approaches:
Option 1: Free Let's Encrypt via DirectAdmin
- Go to DirectAdmin → SSL Certificates
- Select "Let's Encrypt"
- Choose the subdomain you want to secure
- Click "Save" — the system will automatically issue the certificate
Option 2: Wildcard SSL Certificate
If you have multiple subdomains, a Wildcard SSL (*.example.com) is more convenient — it covers all subdomains with a single certificate. AsiaGB offers Wildcard SSL starting at 5,000 THB/year.
| SSL Type | Coverage | Price | Best For |
|---|---|---|---|
| Let's Encrypt | One domain/subdomain at a time | Free | 1–2 subdomains |
| RapidSSL DV | 1 domain or 1 subdomain | 1,000 THB/yr | Critical subdomains |
| RapidSSL Wildcard | *.example.com (all subdomains) | 5,000 THB/yr | Multiple subdomains |
8. Deleting a Subdomain in DirectAdmin
When you no longer need a subdomain:
- Go to DirectAdmin → Domain Setup
- Click your main domain → Subdomains
- Check the box next to the subdomain you want to remove
- Click "Delete Selected"
9. Best Practices for Subdomains
- Keep names short and descriptive: Use clear names users instantly understand — shop, blog, api, docs
- Use SSL on every subdomain: Never run any subdomain on plain HTTP
- Configure robots.txt properly: Development/staging subdomains should disallow all crawlers
- Set low DNS TTL before migration: Lower TTL to 300 seconds before changing IPs so changes propagate faster
- Consistent redirect policy: Choose between www and non-www, then redirect consistently
- Automated backups: AsiaGB performs twice-monthly automated backups (1st and 15th of each month) covering all subdomains in your hosting account
10. Frequently Asked Questions
❓ What is a subdomain?
A subdomain is a prefix added before your main domain, separated by a dot. For example, "blog" in blog.example.com is the subdomain. It lets you create separate sections of your website without buying a new domain name.
❓ Subdomain vs subdirectory — which is better for SEO?
Google treats subdomains as separate sites, meaning they don't automatically benefit from your main domain's authority. Subdirectories (example.com/blog) share SEO authority. For content marketing, subdirectories are generally preferred.
❓ How do I create a subdomain in DirectAdmin?
Log into DirectAdmin → Domain Setup → click your main domain → Subdomains → enter the subdomain name → click Create. DirectAdmin creates the DNS record and folder automatically.
❓ Can I use SSL on a subdomain?
Yes — you can get a free Let's Encrypt certificate for each subdomain via DirectAdmin, or purchase a Wildcard SSL (*.example.com) that covers all your subdomains with a single certificate.
❓ How many subdomains can I create on AsiaGB Hosting?
AsiaGB Hosting allows unlimited subdomains in DirectAdmin. Create as many as your project requires at no additional cost.
❓ How long does subdomain DNS propagation take?
DNS propagation typically takes 1–24 hours. Use dig blog.example.com A or an online DNS checker to verify when your subdomain has propagated.
Conclusion
Subdomains are a powerful and flexible tool for organizing your web presence. Whether you need a separate blog, an e-commerce store, a development environment, or an API endpoint, DirectAdmin on AsiaGB Hosting makes creating and managing subdomains straightforward — just a few clicks.
Remember to set up SSL for every subdomain and configure DNS correctly for optimal security and performance. Have questions about subdomains or domain management? The AsiaGB team is available 24/7 at asiagb.com/contact-en.html