When you host your domain in a server, you may probably get an opportunity to make a few to unlimited numbers of subdomains in that server.
However, the numbers of subdomains you can make in a particular server depends upon plan / price of server. Generally, subdomains are also hosted in the same server.
However, in some cases you may need to host subdomain in different hosting server. The reason might be any of the following.
- Hosting service provider does not allow to create a subdomain on their server.
- Only limited numbers of subdomain are allowed to create on that server
- Main Domain is hosted with Blogger,
- Subdomain you needed for something that requires more speed and storage on the main server is not enough.
There might be some other reasons. If you have any, let me know in the comment before you get started to host subdomain in different hosting server.
Hosting subdomain in different hosting server involves a very easy process. But, if you don’t have idea of what is DNS records and how it works, you may find it a bit difficult.
A Step by Step Guide on How to Host Subdomain in Different Hosting server
The following step-by-step guide will help you to host subdomain in different hosting server. This will hardly take 10-15 minutes in general.
Decide the Subdomain
It is probable that you might have already decided what subdomain you wanted to create.
If you have not decided on the subdomain name yet, decide on a short and relevant subdomain name. Such as shop, blog, services, deals, etc.
Find The Server IP
As you are going to host your subdomain, there is no way to point to the server through nameserver. Therefore, you will need to point your subdomain to the server through the server’s IP address.
To find your server IP address, you will need to log in to your server through cPanel or any control panel your server uses.
In cPanel or vPanel, the IP address of your server appears at the right sidebar or below the main functions area, under the General Information section.
If you can not find it here, your service provider probably has given an IP address such as 184.108.40.206/cpanel to access your cPanel. This will be your server IP. If you are having trouble finding server IP, then contact your hosting service provider, they will definitely provide it.
When you find out the server IP, copy the subdomain hosting server IP address and note it somewhere.
Create an ‘A Record’ with Server IP
Now, go to your domain’s DNS manager. You can find DNS manager in the domain registrar’s dashboard. If you have added your domain to Cloudflare, go to your Cloudflare account and add an “A record” with the following details.
Type of Record – A
Name – The term you want to be the subdomain. For example add “service” for service.example.com
IPv4 Address – The IP address of the server. For example:
Adding Subdomain on New Hosting Server.
This is the final step to host subdomain in different hosting server. Make sure that while checking A records for “service.yourdomain.com” on the DNS checker tool, it is showing your server IP resolving.
Now, to host subdomain in different hosting server, log in to your server i.e cPanel of your hosting server to which you subscribed for the subdomain.
If you have subscribed hosting service especially for the subdomain, it might already contain your desired subdomain as the main domain.
If the hosting service you have subscribed to is for a different domain like mine, you can still add the subdomain in the same way a domain is added.
To add the subdomain as the main domain, there must be an option to add multiple domains.
If your hosting package is for a single domain, then contact the service provider and request to replace the main domain the plan was subscribed to with your desired subdomain. If they do so, your desired subdomain will be added to your server. Therefore you will not be required to read this post further.
If your hosting server is for multiple domains, go to the Domains or Addon Domains option on your cPanel.
Under Domain, click on the add a new domain option. Here, you will need to enter a subdomain (service.example.com) in the field of Domain. Then, you must untick the option that suggests you share a directory with the main domain.
When you untick the box, a new section will appear demanding a subdomain. In this field, you can enter anything.
In my case, grisma.com.np was the main domain for which I purchased the hosting service. As I am currently not hosting this domain in this server I can add any subdomain in the subdomain field.
If your main domain of the server is hosted in the same server the subdomain entered here will redirect you to the subdomain want to host.
In simple words, servicexyz.grisma.com.np should be redirecting to service.grisma.xyz.
Now, just click on the SUBMIT button. In this way, you will be able to host a subdomain on a different hosting server.
Finally, open the subdomain on a browser, you will get a page similar to the following.
Now, you can use this subdomain just like a domain and install anything you like with the help of App Installer or upload a static webpage.
I hope, this blog post helped you to Host subdomain in different hosting server.
If you have any confusion or you are facing difficulties to complete the procedure let me know in the comment section below.
Important: If your server where your subdomain is hosted does not provide an SSL certificate for free, use Cloudflare’s flexible SSL certificate by enabling proxy which I suggested disabling while adding “A Record”.
But, if your main domain is having SSL on the origin server and using strict SSL in Cloudflare then do not enable proxy and make it flexible which will impact your main domain security.
Therefore, get an SSL certificate for your subdomain and install it on the origin server, then make the “A record” proxied.
Summary of How to Host Subdomain in Different Hosting Server
- Decide subdomain you want to create.
- Find the server IP of server where you want to host the subdomain
- Go to DNS manager for your domain (Domain registrar’s or Cloudflare or server where your main domain hosted)
- Create DNS Record (A Record) with name “sub (if you want to make blog.domain.com then only enter blog in this field)” without main domain name and target with server IP of subdomain hosting server
- Go to cPanel and add your domain as addon domain.