Creating a subdomain: explanation and guide
Do you want to create a subdomain for your website but do not know how? Subdomains are enormously handy for organising different parts of your website. Think of a blog, online store or test environment. In this article we explain exactly how you can create a subdomain, what the advantages are, and which mistakes to avoid.
What is a subdomain and why would you create one?
A subdomain is an extra part of your main domain. If your domain name is "company.com", for example, then "blog.company.com" is a subdomain. You can create an unlimited number of subdomains under your main domain, each with its own content and function.
There are many reasons to consider creating a subdomain:
- Separation of content: keep your blog, online store or documentation separate from your main site
- Test environment: create a staging subdomain to test changes
- Multilingualism: use subdomains per language (nl.site.com, en.site.com)
- Different applications: run WordPress on your main domain and an online store on a subdomain
- Email: configure separate mail environments per department
Creating a subdomain in cPanel: step by step
cPanel is one of the most used hosting control panels. Here you can read how to create a subdomain in cPanel:
Step 1: log in to cPanel
Go to your cPanel environment, usually reachable through yourhostingname.com:2083 or through your hosting provider's customer panel. Enter your username and password.
Step 2: go to the subdomain menu
In cPanel, look for the "Domains" section and click "Subdomains". Here you find the form to add a new subdomain.
Step 3: fill in the details
Enter the name of the subdomain (for example "blog"), select the main domain for which you want to create the subdomain, and check the document root path. cPanel automatically suggests a folder.
Step 4: click create
Click the "Create" button. cPanel now creates the subdomain and automatically creates the associated folder on the server.
Step 5: verify the result
Open your browser and go to the new subdomain (for example blog.company.com). If everything is set up correctly, you see the default index page or an empty directory listing.
Creating a subdomain in DirectAdmin
DirectAdmin is another popular hosting panel. The process to create a subdomain is similar:
- Log in to DirectAdmin: go to your DirectAdmin environment and log in
- Go to Subdomain Management: under "Your Account" you find the "Subdomain Management" option
- Enter the name: type the desired name for your subdomain
- Click Create: DirectAdmin creates the subdomain and the associated folder
- Upload files: place your website files in the subdomain's folder
Creating a subdomain in Plesk
Plesk offers a user-friendly interface for managing subdomains:
- Log in to Plesk: open the Plesk panel through your hosting provider
- Select your domain: click the domain for which you want to create a subdomain
- Click "Add Subdomain": you find this option in the domain overview
- Configure the subdomain: enter the name, choose the document root and optionally select an SSL certificate
- Confirm: click "OK" to activate the subdomain
DNS settings for subdomains
When you create a subdomain through a hosting panel, the DNS records are usually created automatically. But sometimes you have to set up DNS records manually, for example if you want to point a subdomain to an external server.
| Record type | Name | Value | Use |
|---|---|---|---|
| A record | blog.company.com | 123.456.789.10 | Subdomain to a specific IP address |
| CNAME record | shop.company.com | shop.platform.com | Subdomain to another domain name |
| AAAA record | app.company.com | 2001:db8::1 | Subdomain to an IPv6 address |
| MX record | mail.company.com | mailserver.company.com | Email for the subdomain |
Propagation time
After creating or changing DNS records it can take up to 24-48 hours before the changes are applied worldwide. This is called DNS propagation. In practice it often takes only a few hours, depending on the TTL (Time to Live) of your DNS records.
Popular applications for subdomains
Subdomains are used for all kinds of purposes. Here are the most common applications:
Blog or knowledge base
Many companies place their blog on a subdomain such as blog.company.com. This makes it possible to manage the blog independently of the main site, for example with a different CMS.
Online store
An online store at shop.company.com is a widely used setup. You can run a platform such as WooCommerce or Shopify on the subdomain, separate from your business website.
Staging and development
Developers use subdomains such as dev.company.com or staging.company.com to test changes before they go live. This prevents errors from becoming visible to visitors.
API and services
Technical services are often placed on a subdomain: api.company.com for the programmatic interface, cdn.company.com for static files, or mail.company.com for the webmail interface.
Country pages and languages
International companies use subdomains per country or language: nl.company.com, de.company.com, fr.company.com. Each version can have its own content and configuration.
Subdomain vs. subfolder: what is better for SEO?
A common question is whether it is better to use a subdomain (blog.company.com) or a subfolder (company.com/blog/). Both have advantages and disadvantages:
| Aspect | Subdomain | Subfolder |
|---|---|---|
| SEO authority | Sometimes seen as a separate domain | Shares authority with the main domain |
| Technical freedom | Own server, CMS and configuration | Shares configuration with the main site |
| Management | Managed independently | Part of the same installation |
| SSL certificate | May need a separate certificate | Shares the main domain's certificate |
| Google recommendation | Both are indexed | Subfolder has a slight advantage for SEO |
For SEO purposes a subfolder often has a slight advantage, because all link authority stays with the main domain. But if you technically need a separate environment, a subdomain is the better choice.
Common mistakes when creating a subdomain
The same mistakes are often made when creating subdomains. Here are the main pitfalls and how to avoid them:
- No SSL certificate: do not forget to set up an SSL certificate for your subdomain too. A wildcard certificate covers all subdomains
- Wrong DNS records: check whether the A record or CNAME points correctly to the right server
- No redirect from www: set up a redirect from www.subdomain.company.com to subdomain.company.com (or the other way around)
- Forgotten document root: make sure the folder the subdomain points to actually contains files
- Conflicts with existing folders: a subdomain "blog" can conflict with a /blog/ folder on your main domain
- Too many subdomains: although you can technically create unlimited subdomains, too many subdomains make management complex
Setting up an SSL certificate for subdomains
Each subdomain needs its own SSL certificate, unless you use a wildcard certificate. There are three options:
- Let's Encrypt per subdomain: free, renewable automatically, but you have to add each subdomain separately
- Wildcard SSL certificate: covers all subdomains with a single certificate (*.company.com), offers convenience but is more expensive
- SAN certificate: add specific subdomains to a Multi-Domain certificate, flexible and affordable
With most domain name and hosting providers you can easily request a free Let's Encrypt certificate for your subdomains. For most situations this is the best and cheapest solution.
Frequently asked questions about subdomains
How many subdomains can I create?
Technically there is no limit to the number of subdomains you can create. Some hosting plans, however, set a limit. Check this with your hosting provider.
Does a subdomain cost extra money?
In most cases no. Subdomains are free to create with almost every hosting provider. You only pay if you need extra hosting, storage space or a separate SSL certificate.
Can I point a subdomain to another server?
Yes, by changing the A record or CNAME of the subdomain in your DNS settings you can point the subdomain to any server you want.
How do I remove a subdomain?
In your hosting panel (cPanel, DirectAdmin or Plesk) you can easily remove the subdomain. Do not forget to also clean up the associated DNS records and files.
Creating a subdomain is simpler than you think. With the step-by-step guides in this article you can set up a subdomain in cPanel, DirectAdmin or Plesk within a few minutes. Whether you want to set up a blog, online store, test environment or multilingual site, subdomains offer the flexibility you need.
Do keep the basic checks in mind: set up an SSL certificate, check your DNS records and test whether everything works correctly. With the right configuration your subdomain is a powerful addition to your domain name and online strategy.
Creating a subdomain: practical applications
Creating a subdomain is not only a technical action, it offers strategic advantages for your website structure. Here are the most common applications.
Online store on a subdomain
Many companies place their online store on a subdomain: shop.yourcompany.com. This separates the online store technically from the main website, so that updates and maintenance can happen independently. The online store can run on a heavier hosting environment (more memory, better databases) while the business website runs on a lighter plan. Do make sure branding and navigation are consistent between both parts.
Staging environment on a subdomain
A popular application is setting up a staging environment on a subdomain such as test.yourcompany.com. Here you test updates, new plugins and design changes before you put them live. Secure the subdomain with a password (HTTP Basic Auth) and add a noindex meta tag so that search engines do not index the test environment.
Multilingual websites
For multilingual websites you can use subdomains per language: nl.yourcompany.com for Dutch, en.yourcompany.com for English, de.yourcompany.com for German. This gives each language version a clear structure and makes it easy to set up hreflang tags correctly for SEO. Google treats subdomains as separate websites, which can be both an advantage and a disadvantage depending on your SEO strategy.
Creating a subdomain: technical guide
Actually creating a subdomain differs per control panel. Below you find the steps for the most popular options.
Creating a subdomain in DirectAdmin
Log in to DirectAdmin, go to Subdomains under the Account Manager heading, click Add Subdomain, enter the name (for example blog) and click Create. DirectAdmin automatically creates a folder in your public_html directory. Upload your files to this folder or install a CMS. The subdomain is usually reachable within a few minutes.
DNS configuration for subdomains
Each subdomain needs its own DNS record. Usually this is an A record that points to your server's IP address, or a CNAME record that points to your main domain. If your subdomain has to be on a different server (for example a separate VPS for your online store), create an A record with the IP address of that server. After creating it, check through a DNS checker whether the record is configured correctly.
Subdomain vs subdirectory: the right choice
A common question is whether it is better to use a subdomain (blog.yourcompany.com) or a subdirectory (yourcompany.com/blog/). Both have their own advantages and disadvantages.
SEO considerations
Google treats subdomains as separate websites. This means the link value (authority) of your main domain does not automatically flow through to a subdomain. For SEO a subdirectory is therefore usually the better choice, all content contributes to the authority of one domain. Only use subdomains when there are technical reasons (different CMS, different server) or when the content is so different that it is logical to treat it as a separate website.
When to use a subdomain after all
- Different CMS needed: your main site runs on WordPress but your online store on Magento
- Different server required: your application needs a VPS while your website runs on shared hosting
- Independent management: different teams manage the main site and the subdomain
- Test environment: a staging site does not need to have SEO value
- SaaS product: customer portals on a subdomain (customer.yourplatform.com)
Creating a subdomain: frequently asked questions
Questions come up regularly when creating a subdomain. How many subdomains can I create? Most hosting plans offer unlimited subdomains. Does a subdomain cost extra? No, subdomains are free, after all you use your existing domain. Does a subdomain need a separate SSL certificate? A Wildcard SSL certificate covers all subdomains; otherwise you need a separate certificate per subdomain. Can I install WordPress on a subdomain? Yes, each subdomain can host a fully independent website with its own CMS installation. Does a subdomain affect my main SEO? Subdomains are treated by Google as separate websites, so they build authority independently.
Creating a subdomain: best practices
Follow these best practices when creating a subdomain for an optimal result. Choose a descriptive name that makes clear what the subdomain contains (shop, blog, support, staging). Secure each subdomain with an SSL certificate, including subdomains that are not publicly accessible. Set up the correct DNS records for each subdomain. Give staging and test subdomains a password protection and a noindex tag. Monitor the performance of each subdomain separately. Document which subdomains are active and what they are used for, so that you keep an overview as your domain structure grows. Remove unused subdomains to reduce your attack surface.
Creating a subdomain: technical troubleshooting
After creating a subdomain it can happen that it does not work immediately. The most common problems and solutions are: the subdomain is not reachable (wait up to 24 hours for DNS propagation or check the DNS records), an error message appears (check whether the document root is set correctly and whether there are files in the folder), or the SSL certificate does not work (request a separate certificate or configure a wildcard certificate). If you experience problems with email on a subdomain, check the MX records specifically for that subdomain.
Creating a subdomain: summary
Creating a subdomain is a powerful technique to organise your website structure and achieve specific goals. Use subdomains for online stores, staging environments, multilingual sites and customer portals. Create the subdomain through your control panel, configure the correct DNS records, secure it with SSL, and test thoroughly before you put it into use. Always weigh the advantages and disadvantages against a subdirectory, and choose the solution that best fits your technical and SEO goals.
Creating a subdomain: DNS configuration in detail
When creating a subdomain, the correct DNS records are essential. Create an A record that links the subdomain to your server's IP address. If the subdomain points to the same server as your main domain, you can also use a CNAME record that points to your main domain. For email on a subdomain, configure separate MX records specifically for that subdomain. Do not forget the TXT records for SPF and DKIM if you send email from the subdomain. Set the TTL (Time to Live) to 3600 seconds for stable subdomains or 300 seconds if you expect to make changes soon.
Creating a subdomain: real-world examples
Real-world examples show when creating a subdomain is the right choice. An online store at shop.yourdomain.com keeps your e-commerce separate from your business website. A staging environment at test.yourdomain.com offers a safe place to test changes. A blog at blog.yourdomain.com can run on a different platform from your main site. A customer portal at portal.yourdomain.com offers a separate, secure environment. An API at api.yourdomain.com separates your backend services. Each subdomain can use its own SSL certificate, its own configuration and even a different server, which offers maximum flexibility in your website architecture.
Creating a subdomain: SEO impact and considerations
The choice between a subdomain and a subdirectory has SEO consequences. Google considers subdomains as separate websites, which means the domain authority is not automatically shared. A blog post at blog.yourdomain.com benefits less from the authority of yourdomain.com than a post at yourdomain.com/blog/. For most websites, SEO experts therefore advise a subdirectory. Subdomains are the best choice for applications that have to be technically separated: an online store on a different platform, a helpdesk system, or a staging environment. Use subdomains strategically and choose subdirectories when SEO synergy is important.
With the information in this article you can confidently create and configure a subdomain for your specific application. Always consider the SEO consequences, secure each subdomain with SSL and test thoroughly before you put it into use for your visitors and customers.
Do you want to know whether a domain name is still available? Use our free domain name checker to check this immediately.