Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Host Your Main Domain and Subdomain on Two Different Servers

This guide shows how to keep your main website in one place and run a subdomain from another server. You do this with DNS records.

Domains and DNS2 min read9 steps

What are these words?

A domain is the name of your website, like example.com. A subdomain is a smaller name in front of it, like blog.example.com.

DNS is like a phone book for the internet. It tells computers which server holds each name. An A record is one line in that phone book. It connects a name to an IP address, which is the number of a server.

The main domain and its subdomain have separate lines. So each can point to a different server.

What you need

  • The IP address of the server for the main site.
  • The IP address of the server for the subdomain. Your welcome email or the hosting company will have it.
  • Access to the place where your DNS is managed.

Steps

  1. Log in to your DNS manager. If your domain is with Hostvento, log in at https://secure.hostvento.com/clientarea.php.
  2. Open the Domains menu and find your domain.
  3. Open the DNS settings. This may be called Manage DNS or DNS Management. If your DNS is in cPanel, use Zone Editor instead.
  4. Find the A record for the main name (example.com). Make sure it holds the IP of the main server.
  5. Add a new A record for the subdomain. Set the name to blog (or your chosen word).
  6. In the value or address box, type the IP of the second server.
  7. Save the changes.

Set up the second server

  1. On the second server, add the subdomain in the control panel. In cPanel, use Domains or Subdomains.
  2. Upload your site files to the folder it makes.

If the second server does not know the subdomain, visitors will see an error or a default page.

Wait and test

DNS changes can take a few hours to spread. Sometimes it is quicker. After that, open both addresses in your browser. Each should show its own site.

Tip: Check that the name servers of your domain really point to the DNS manager you are editing. If not, your changes will have no effect.

Quick recap

  • A subdomain has its own DNS line, so it can live on another server.
  • Add an A record for the subdomain with the second server's IP.
  • Add the subdomain on the second server too.
  • Wait for DNS to spread, then test both sites.