What Are Subdomains? A Comprehensive Guide For Beginners
What are subdomains? Subdomains are the part before the first dot in the URL structure. They function as an extension of a primary domain to create an organized directory for different sections of your website.
Popular uses for subdomains on a website include creating separate stores and shops, blogs, and forums. For example, stats.hostinger.com. In this URL, “stats” is the subdomain, “hostinger” is the second-level domain (SLD), and “.com” – the top-level domain (TLD).
To better understand what are subdomains, this article will explain everything you need to know about them.
You’ll learn how they differ from domain names, what they are used for, how to create them, and how they affect your website’s SEO.
What Is the Difference Between a Subdomain and a Domain?
Subdomains and domains are part of a website’s URL. The main differences between a subdomain and a domain are how they are used and what they are used for.
A domain, also referred to as a root domain, is an essential part when creating a website. It converts the IP address of your site into an easy-to-remember address such as hostinger.com.
In short, a domain is what people type in the address bar of a web browser to access your website. Meanwhile, a subdomain is an additional part of an existing domain that’s mainly used for site organization purposes.
Structure-wise, here is an example of how subdomains and domains differ:
Even though “www” is technically a subdomain – and the most common one, it is not used in the same way as other subdomains.
In addition, there’s the fully qualified domain name (FQDN), which consists of the hostname or the computer and the domain name.
What Are Subdomains Used for?
Besides being great for site organization purposes, you can create subdomains to help you with several other tasks, such as:
- Testing out a new website. You can edit and rebuild sites without having to put the main domain in maintenance mode.
- Launching different language versions of your site. You can have separate websites that cater to different regions. For example, in.yourdomain.com for India, to fr.yourdomain.com for France, and id.yourdomain.com for Indonesia.
- Creating a mobile version of your website. To make sure the site looks and works great on mobile devices, you can use a subdomain URL such as m.yourdomain.com, for example.
- Offering different products and services. Separate your forum site, store, blog, help center, and other unique content from the main domain.
- Creating unique designs. You can host your subdomains on platforms that offer better services for your needs, such as other CMSs, website builders, or eCommerce site builders.
- Better site organization. For instance, having a subdomain for customer support allows your business to have a dedicated website for FAQ, community, documentation, and other help pages.
How to Create a Subdomain?
In this section, you’ll find the step-by-step process of creating a subdomain using both methods.
1. Create a Subdomain via hPanel
To create subdomains via our hPanel, your domain must be pointing to Hostinger.
However, if your domain name is registered in another registrar, simply follow our guide to point your domain to Hostinger.
Once done, go to your hPanel dashboard and scroll down to the Domains section. Click on Subdomains.
Enter your intended subdomain and click Create.
You can tick on the Custom folder for subdomain box if you want to create a specific custom directory.
Once done, you’ll get a pop-up on the upper right corner of the screen saying “Subdomain created successfully.” Right below, there will be a box with the “List of Current Subdomains” so you can check its information or even delete it.
Now, you need to install the platform you want to use in your subdomain. For the purpose of this tutorial, we’re going to select WordPress.
Navigate to the Website tab on the left menu bar and click Auto Installer.
From there, Select WordPress as the platform for your subdomain.
Fill in the required fields to install WordPress on your subdomain:
- Select the subdomain of your choice
- Add your login credentials
- Add the website title
- Select a language
Once you’ve filled out the form, click Install. This may take a few minutes.
Now, your subdomain should be listed here:
Keep in mind that creating a subdomain adds an entry in your DNS zone, so it can take up to 24 hours for the new subdomain to start working.
2. Create a Subdomain via Your DNS Zone
If your domain is registered with Hostinger, another option is to create a subdomain via your DNS zone editor.
Scroll down to the Advanced section of your hPanel dashboard and select DNS Zone Editor.
Now, fill in the required fields to add a new DNS record:
- Type. Select A from the drop-down menu as subdomains use an A record to point to an IP address.
- Name. Change it to the subdomain name you want. For example, fill in with “gallery” to create the URL gallery.yourdomain.com.
- Points to. Fill in with the IP address of your hosting account.
- TTL (Time to Live). It is a setting that tells the DNS resolver for how long to cache information before requesting a new one. The default is 14,400 seconds.
Once completed, hit Add Record, and you should see it listed right below the Manage DNS records field.
Under your new subdomain, you’ll also find a CNAME (Canonical Name) record for the subdomain “www.” Unlike the A record, it must point to a domain name.
For example, if someone types the URL www.yourwebsite.com on their browser, they will be redirected to yourwebsite.com instead of getting a “page not found” error.
After creating a subdomain via your DNS zone, it’ll take up to 24 hours for the changes to take effect and the subdomain to work.
To keep your subdomains organized, create a subfolder in your domain’s /public_html folder via your file manager.
To create and delete subdomains on cPanel, first access your cPanel accounts and click on Subdomains. Next, choose a domain for your new subdomain and specify the custom directory.
After the subdomain is created, you can check its information, remove it, or create a redirect, in the Modify a Subdomain section.
Subdomain vs. Subdirectory
Similar to subdomains, subdirectories allow you to better organize your site and its content. First, let’s take a look at how the two differ in structure.
- Subdomain: blog.yourdomain.com
- Subdirectory: yourdomain.com/blog
Essentially, a subdomain creates another website for your content. You can completely redesign the interface and treat it as a separate site from the domain name.
Subdirectories, on the other hand, are parts of the website – they are a subfolder inside the site’s files.
Ideally, you should use subdomains for separating extensive content or a web page that is too distinct from the rest of the site, such as a dedicated customer support or a unique product or service.
Subdomains and subdirectories may also have a different impact on your SEO strategy. It’s important to understand the difference between the two scenarios and how they can impact your site’s SEO efforts.
Subdomains vs. Subdirectories for SEO
There has been an ongoing debate about whether subdomains or subdirectories are better for sites’ SEO.
This is due to the fact that search engines like Google might treat subdomains as separate entities from the rest of the site. Thus, subdomains will rank differently than the main websites.
Meanwhile, subdirectories help with crawling as Google recognizes that these sections are part of the bigger website on the main domain.
It is recommended that you use the setup that works best for the site and think about the long-term plan when making a choice.
Subdomains are used to separate specific content from the website on the main domain. You can use a subdomain to create test sites, offer unique products or services, or publish content in different languages to improve your visitors’ browsing experience.
Creating a subdomain is quite simple. You can do it via your hPanel or the DNS zone on your hosting provider’s dashboard. The number of subdomains you can create depends on your domain registrar or hosting provider.
Keep in mind that subdomains are different from subdirectories. It’s important to understand the difference between the two and choose one that’s most suitable for your website’s structure and SEO efforts.
Hopefully, this article has helped you better understand what are subdomains and the best practices for using them.
Good luck on your website-building journey.