Back to Blog

What Is a Subdomain and How Do You Create One?

What is a subdomain and how do you create one? Subdomains with DNS records, creating one in cPanel and DirectAdmin, pointing it to a game server, and SSL.

Nodesty Team5 min readHosting
The word Subdomain with DNS, A record and Wildcard on a dark Nodesty background

A subdomain is a prefix added in front of your main domain that works like a separate address, such as blog.yourdomain.com, panel.yourdomain.com or mc.yourdomain.com. As the owner of the domain, you can create as many subdomains as you like for free and point each one to a different server, site or service. While your main site sits on web hosting, one subdomain can point to your game server and another to your admin panel.

This article covers what a subdomain is, what it's used for, how to create one with a DNS record and from a control panel, pointing one to a game server, SSL and how it differs from a subfolder for SEO.

How does a subdomain work?

Let's read the address blog.yourdomain.com from right to left: .com is the extension, yourdomain is your domain and blog is the subdomain. We explain the parts of a domain in our What is a domain name? article.

A subdomain has its own records in DNS. While yourdomain.com points to one server, blog.yourdomain.com can point to a completely different one. The browser or game looks at the subdomain's DNS record to connect to the right server.

What is a subdomain used for?

  • Separate applications: Subdomains such as panel., app. or api. are used for applications that run independently of the main site.
  • Game servers: A memorable address such as mc.yourdomain.com means players don't have to remember an IP address.
  • Test environments: You can run a copy of your site on a test. or staging. subdomain and try out changes before they go live.
  • Email and services: Addresses such as mail. or webmail. point to email services.
  • Regional or language-specific sites: Subdomains such as en. or de. can be used for sites in different languages.

Creating a subdomain with a DNS record

To create a subdomain, you add a record where you manage your domain's DNS (your registrar, your hosting panel or a DNS provider such as Cloudflare):

Record typeNameValueWhen?
Amc203.0.113.10To point to an IPv4 address
AAAAmc2001:db8::10To point to an IPv6 address
CNAMEwwwyourdomain.comTo make an alias for another domain
  • An A record points the subdomain directly to a server's IP address; it's the most common method for game servers and your own servers.
  • A CNAME record links the subdomain to another domain; the record keeps working even if the target's IP address changes. If a service provider asks you for a CNAME record, use this one.

We explain DNS record types and propagation time in detail in our What is DNS? article.

Creating a subdomain in cPanel and DirectAdmin

When you create a subdomain on web hosting, the control panel sets up both the DNS record and the folder where the site's files will live for you:

  • cPanel: In the Domains section, add a new domain and type the subdomain (blog.yourdomain.com). The panel suggests a folder for the files; you can change it if you like.
  • DirectAdmin: In the Subdomain Management section, type the subdomain's prefix and create it.

If your domain's nameservers point to your hosting company, the DNS record is added automatically. If the nameservers are somewhere else, you need to add an A record for the subdomain pointing to your hosting server at your DNS provider yourself. On hosting plans, the number of subdomains you can create may depend on the plan's limits.

Pointing a subdomain to a game server

To give your players an address such as mc.yourdomain.com instead of 203.0.113.10:

  1. At your DNS provider, add an A record for the name mc pointing to your game server's IP address.
  2. If the game uses the default port (25565 for Minecraft Java Edition), players connect just by typing mc.yourdomain.com.
  3. If you use a different port and the game supports it, add an SRV record so players can connect without typing the port. Minecraft Java Edition supports the _minecraft._tcp SRV record.

If you use Cloudflare, leave the game server's record as a grey cloud (DNS only); Cloudflare's proxy doesn't carry game traffic. The details are in our What is a CDN? article.

SSL for a subdomain

To work over HTTPS, every subdomain needs its own SSL certificate or a certificate that covers it:

  • On web hosting, a free SSL certificate is usually issued automatically after you create the subdomain; if it isn't, enable it from the SSL section of the control panel. The DNS record must point to your hosting server.
  • On your own server, you get a certificate for the subdomain with Certbot: sudo certbot --nginx -d blog.yourdomain.com.
  • A wildcard certificate (*.yourdomain.com) covers all subdomains with a single certificate. Getting a wildcard certificate from Let's Encrypt requires DNS validation.

We explain how SSL works in our What is an SSL certificate? article.

Subdomain or subfolder?

When you add a blog or a help center, you have two options: blog.yourdomain.com (a subdomain) or yourdomain.com/blog (a subfolder).

FeatureSubdomainSubfolder
Technical separationCan be a separate server or applicationRuns in the same place as the main site
SEOMay be treated as a partly separate siteSeen as part of the main site
Best forPanels, applications, game servers, test environmentsBlogs, guides, product pages

For content you want to boost your main site's strength in search engines, a subfolder is usually the better choice; for applications that need to run separately at a technical level, a subdomain usually is.

Subdomains with Nodesty

On Nodesty web hosting plans, you can create subdomains in a few clicks through cPanel or DirectAdmin and use a free SSL certificate for each one; the number of subdomains you can create depends on your plan. If you run your game server or your own applications on an AMD Ryzen 9 9950X VPS, all you need to do is add an A record for your subdomain pointing to your server's IP address.

Frequently Asked Questions

Do I have to pay extra for a subdomain?

No. As the owner of a domain, you can create as many subdomains as you like for free; you only need to add a DNS record. On hosting plans, the number of subdomains you can create may depend on the plan's limits.

How long does it take for a subdomain to work?

A new DNS record usually starts working within a few minutes. If there was already a different record for the same name, or it was cached somewhere, it can take a few hours for the change to show up everywhere, depending on the record's TTL.

Is a subdomain or a subfolder better for SEO?

Search engines may treat subdomains as a site partly separate from the main site, while subfolders (yourdomain.com/blog) are seen as part of the main site. For content you want to strengthen your main site, such as a blog, a subfolder is usually the better choice. A subdomain suits a panel, a status page or a separate application.

What is a wildcard subdomain?

A wildcard record (*.yourdomain.com) makes every subdomain that isn't defined point to the same server. It's used in applications that give each customer their own subdomain. Getting a wildcard SSL certificate requires DNS validation.

How do I share my Minecraft server with a subdomain?

Add an A record for mc.yourdomain.com that points to your server's IP address. If the server uses the default port 25565, players connect just by typing this name. If you use a different port, an SRV record lets players connect without typing the port.

I use Cloudflare. Why doesn't my game server's subdomain work?

Cloudflare's proxy only carries web traffic. Set the record for the subdomain pointing to the game server with the proxy turned off, as a grey cloud (DNS only); with the orange cloud on, players can't connect.

Nodesty

About the author

Nodesty Team · Infrastructure & Support

The Nodesty team runs our servers, network and DDoS protection day to day and answers customer support requests around the clock. These guides come from that work.

Related articles

Launch your server now.

Build, scale, and conquer without limits on Nodesty's premium infrastructure.

                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                             ············································                                                   
                                                ··································································································..........···························                                     
                                       ················..........................................................................................................................··············                             
                                  ·············.................::::::::::::::::::::::::::::::::::::::::::::::....................:::::::::::::::::::::::::::::::::::::::................···········                        
                             ············................:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::............·········                     
                         ············.................:::::::::::::::::::::::::::::::::::::::::::::::::::------------::::::::::::::::::::::::::::::----------------:::::::::::::::::::::..........········                  
                    ············......................::::::::::::::::::::::::::::::::::::------------------------------------------------------------------------------------:::::::::::::.........········                
                ··········.............................................::::::::::::::::::-------------==========================================-----------------------------------:::::::::::........·······               
             ········..................:.....................................::::::::::--------=======+++++++++++++++++++++++++++++++++++++=========================------------------::::::::::.......·······              
           ······.........::::::::::::::::::::................................:::::::-----=====++++xxxxxx**************************xxxxxxxxx++++++++++++++===================------------::::::::.......·······             
          ·····.......:::::::::::::::::::::::::::.............................:::::----===+++xxx****%%%%&&&&&&#############&&&&&&&%%%%%*******xxxxxxxx++++++++++++++==============----------:::::::......······             
         ····......::::::::-------------:::::::::::..........................::::---===+++xx***%%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@####&&&&&%%%%*******xxxxxxxxx+++++++++++++===========--------::::::......·····             
        ····.....:::::::--------------------:::::::::.......................::::---===++xxx**%%&&&###@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&%%%%%********xxxxxxxxxxx++++++++++++========------::::::.....······            
        ····.....:::::--------------------------::::::::....................::::---===++xx***%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&&%%%%%**********xxxxxxxxxxxxx+++++++++=======------:::::.....·····            
        ····....::::::-------=============---------:::::::::................:::::---===+++xx***%%%&&&#####@@@@@@@@@@@@@@@@@@@@@@@@@#####&&&&&%%%%%%*************xxxxxxxxxxxxxx+++++++++======-----:::::....·····            
         ····....:::::-------================---------:::::::::...............:::::----===++++xxx***%%%%&&&&&&#################&&&&&&%%%%%%%*******************xxxxxxxxxxxxxxxxx++++++++======----:::::....·····            
         ·····....:::::--------=================---------::::::::::..............:::::::-----====+++++xxxxxx**************************xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx++++++++=====-----::::....·····            
          ·····.....:::::--------=================----------:::::::::::.................:::::::::-------=============++++++++++++++++++++++++++++++++++++xxxxxxxxxxxxxxxxxxxxxxx++++++++======-----::::....·····            
            ·····.....:::::::----------===========-------------::::::::::::.........................::::::::::::::::::------------------=============+++++++++++++++++++++++++++++++++=======-----::::.....·····            
              ······......:::::::---------------------------------:::::::::::::........................................:::::::::::::::-----------============+++++++++++++++++++++========------:::::.....·····             
                 ······........:::::::::---------------------------:::::::::::::::::...........................................:::::::::::::------------=============================--------::::::.....······              
                    ·········.........:::::::::::::::-------------::::::::::::::::::::::::.......................................::::::::::::::::--------------------------------------::::::::......·······                
                          ··········............::::::::::::::::::::::::::::::::::::::::::::::::::................................::::::::::::::::::::::::::-------------:::::::::::::::.........········                   
                                  ············..................:::::::::::::::::::::::::::::::::::::::::::.........................:::::::::::::::::::::::::::::::::::::................···········                        
                                             ················.............................................................................................................·················                                 
                                                           ······················................................................................···························                                                
                                                                               ·········································································