How to Host Subdomain on Different Server

Hello Dev, are you looking to host a subdomain on a different server? Well, you have come to the right place. In this article, we will guide you through the process of hosting a subdomain on a different server step by step. You do not need any prior technical knowledge, just follow the instructions and get it done in no time.

Step 1: Choose a Hosting Provider

The first step in hosting a subdomain on a different server is to choose a hosting provider. You can choose any hosting provider, but make sure that they offer cPanel access as it makes the process easier. We recommend using a reliable hosting provider like Bluehost or SiteGround.

Once you have chosen the hosting provider, purchase a plan that meets your requirements. After purchasing the plan, log in to your hosting account and navigate to the cPanel dashboard.

What is cPanel?

cPanel is a web-based control panel that allows you to manage your hosting account. It provides a graphical interface and automation tools designed to simplify the process of hosting a website.

How to Access cPanel?

To access cPanel, log in to your hosting account and navigate to the cPanel dashboard. The URL for accessing cPanel is usually yourdomain.com/cpanel.

Step 2: Add a Subdomain

The next step is to add a subdomain to your hosting account. To add a subdomain, follow the steps below:

Steps
Action
Step 1
Log in to your cPanel account
Step 2
Click on the ‘Subdomains’ option
Step 3
Enter the name of the subdomain in the ‘Subdomain’ field
Step 4
Choose the domain on which you want to create the subdomain from the drop-down list
Step 5
Choose the document root directory for the subdomain. You can choose the default directory or create a new one
Step 6
Click on the ‘Create’ button

After adding the subdomain, it will take some time to propagate. Once it is propagated, you can access the subdomain using the URL subdomain.yourdomain.com.

Step 3: Point the Subdomain to a Different Server

The next step is to point the subdomain to a different server. To do this, follow the steps below:

Step 3.1: Obtain the IP Address of the New Server

Before you can point the subdomain to a different server, you need to obtain the IP address of the new server. You can obtain the IP address from your new hosting provider or by pinging the domain name of the new server.

Step 3.2: Update the DNS Records of the Subdomain

To point the subdomain to a different server, you need to update the DNS records of the subdomain. To update the DNS records, follow the steps below:

Steps
Action
Step 1
Log in to your domain registrar account
Step 2
Navigate to your domain’s DNS settings
Step 3
Locate the DNS records of the subdomain
Step 4
Update the ‘A’ record of the subdomain with the IP address of the new server
Step 5
Save the changes

After updating the DNS records, it will take some time to propagate. Once it is propagated, you can access the subdomain using the URL subdomain.yourdomain.com.

READ ALSO  Python Web Server Hosting for Dev - A Comprehensive Guide

Step 4: Configure the New Server

The final step is to configure the new server to host the subdomain. To configure the new server, follow the steps below:

Step 4.1: Add the Subdomain to the New Server

To add the subdomain to the new server, follow the steps below:

Steps
Action
Step 1
Log in to your new server
Step 2
Open the terminal or command prompt
Step 3
Navigate to the directory where you want to host the subdomain
Step 4
Create a new directory with the name of the subdomain
Step 5
Assign the appropriate permissions to the directory

Step 4.2: Upload the Website Files

To upload the website files to the new server, follow the steps below:

Steps
Action
Step 1
Log in to your FTP account
Step 2
Navigate to the directory of the subdomain on the new server
Step 3
Upload the website files to the directory

Step 4.3: Test the Subdomain

To test the subdomain, open a web browser and type subdomain.yourdomain.com. The website should be displayed from the new server.

Conclusion

Hosting a subdomain on a different server may seem like a daunting task, but it is easy if you follow the steps outlined in this article. Just remember to choose a reliable hosting provider, add a subdomain, point the subdomain to a different server, and configure the new server. If you have any questions, feel free to ask in the comments section below.

FAQs

Q1. Can I host multiple subdomains on different servers?

Yes, you can host multiple subdomains on different servers. Just follow the same process for each subdomain.

Q2. Can I use a different hosting provider for the subdomain?

Yes, you can use a different hosting provider for the subdomain. Just make sure that they offer cPanel access and follow the same process outlined in this article.

Q3. How long does it take for the DNS records to propagate?

The DNS records usually take 24-48 hours to propagate, but it can take longer in some cases.

Q4. What if I make a mistake while updating the DNS records?

If you make a mistake while updating the DNS records, you can revert the changes or contact the domain registrar for assistance.

Q5. How do I know if the DNS records have propagated?

You can check the DNS propagation using online tools like WhatsMyDNS or DNS Checker.