1. Knowledge Base
  2. >
  3. What is a Subdomain Name & How to Create One

What is a Subdomain Name & How to Create One

It is not always necessary to register a new domain name when what you already own works perfectly fine. Rather than registering a new domain name, you can always create a subdomain using your existing domain name.

A subdomain is an addon to your primary domain with its unique content. It is a separate part of your website that operates under the same primary domain name without you purchasing a new domain. You can also create unlimited subdomains for every domain you own.

Please note that creating subdomains does not register a new domain name automatically. To register a new domain name, you may want to visit our front-of-site https://www.hostgator.com/domains. For instructions on registering a new domain, please visit the following article.

When should I use a subdomain name?

You may ask yourself, what do I need subdomains for? Here are some scenarios where you'll find a subdomain to be useful.

  • Add a help or support page
    When your website requires a tutorial or documentation section, it is best to use a subdomain as a "subpage" on your website. Let's say your site has this "Frequently Asked Questions (FAQs) page. It will be easier for your visitors to find what they are looking for. It will also be easier for you to create a page with a ton of information while still associating your "support" page with your main website.
     
  • Set up an e-commerce page on your site
    The time may come that you'll want to introduce your website to more people and, of course, earn from your product or service, then that's when you will need an e-commerce site. However, integrating the e-commerce store into your existing site may be difficult as it might disrupt the configuration of your main website.

    Instead of restructuring or redesigning your existing website, you can use a subdomain to create an e-commerce store. That will give you the freedom to create a whole new webpage, where you can sell your products or service and cater to your customers without disrupting the main site.
     
  • Create a test page for your website
    You may want to add a new feature, create a new layout or redesign your site; however, you do not want to disrupt your live website. You'll find that creating a test page using a subdomain is a good idea. You can play around with your test page and see its live version without causing your live website to break down. When you're ready to publish your test page, you can transfer your redesigned site to your main website.
Here are some support blogs you can use to find more information on when and where to use subdomains.

How the subdomain name appears

Assuming you already host the main domain "hgexample.com," examples of subdomains are:

  • blog.hgexample.com
  • forums.hgexample.com
  • help.hgexample.com

How to create a subdomain

We created a video tutorial to guide you in creating a subdomain within your cPanel. 


To create a subdomain:

  1. Log in to cPanel.
  2. Locate the Domains section, then click the Subdomains icon.

    HostGator cPanel Subdomains

  3. In the Subdomain field, enter your preferred subdomain name.

    cPanel - Create Subdomain

    For the sample image above, we used "blog" as the subdomain for the main domain, "example.com."

  4. In the Domain dropdown, select the domain where you wish to associate the subdomain.
  5. The Document Root field is automatically populated once you enter your subdomain name. You can edit or change the document root file path if you want.
  6. Hit the Create button.
  7. Your new subdomain will be displayed on the same page. You can click the Document Root link to go to the subdomain's folder or directory within the File Manager.

    Subdomain's Document root

 

To delete a subdomain:

  1. In the Subdomains section, locate the subdomain you wish to delete.
  2. Under the Actions column, click Remove.

    cPanel - Remove Subdomains

  3. Click on the Delete Subdomain button to confirm the deletion.

Related Articles

Do you need addon domains? Here are some articles on creating addon domains within cPanel.

Need additional assistance? HostGator's Support is here to help. Please contact us via phone or Live Chat so we can assist you!