Point a Subdomain to a Different Server Without Moving Your Main Website
Your main website is happy on its current hosting, but you want the shop, the test copy or a dashboard on a different server. Good news: a subdomain does not care where its parent site lives. Each name can point at its own machine.
🎥 Watch the complete video guide on the Technical Anshu YouTube channel
Beginners often believe a domain is glued to one server. It is not. DNS is per-name, not per-domain:example.com can live on Hosting A while shop.example.com lives on a VPS in another country and nas.example.com points at your office — all at the same time, all free. But the setup has two sides, and the second side is the one everyone forgets: the new server must also be told that it answers for this subdomain. DNS alone brings the visitor to the door; the server still has to open it.
One domain, three homes (example values)
Name Points to Lives at
example.com -> 203.0.113.15 Main hosting (unchanged)
shop -> 198.51.100.24 Separate VPS
test -> 203.0.113.44 Cheap second hosting
nas -> Home public IP Office NAS (DNS only)
👆 Only the shop row is new here — the main website row is never touched
1
Side One — The Cloudflare Record
In Cloudflare: DNS → Records → Add record
If the second server gave you an IP, add an A record: Name = shop, Content = that server's IP. If it gave you a hostname, use a CNAME instead
Do not touch the existing records for @ (your root) or www — your main website keeps working exactly as before
Save and give it a few minutes. This side is now done — but the work is only half finished
2
Side Two — Tell the Second Server Its Name
This is the step whose absence produces the classic complaint “the subdomain opens the wrong website” or a hosting default page:
Log in to the second server's panel (hosting control panel, or the server itself)
Add the full subdomain — shop.example.com — as an addon domain, a new website, or a virtual host, and note which folder it serves from
Put your files in that folder. A server that receives a name it does not know shows its default page or another site it hosts — that behaviour is correct, not a DNS fault
Issue an SSL certificate for this subdomain on this server (free Let's Encrypt works) — especially important if the Cloudflare record is Proxied with SSL mode Full, because Cloudflare then expects a valid certificate on this origin too
3
Decide the Proxy for This Subdomain Separately
Proxy status is per record, so the split setup gets its own choice:
Public web things (shop, landing page on the VPS): Proxied is fine and hides the second server's IP
Admin and non-web things (NAS, FTP name, server panels): DNS only. A proxied FTP or SSH name simply will not connect — Cloudflare's proxy speaks web protocols
Mixing is normal. There is no rule that a domain must be all-orange or all-grey
4
Test It Like a Visitor, Not Like the Owner
Check the name resolves: nslookup shop.example.com — you should see the second server's IP (grey cloud) or Cloudflare IPs (orange cloud)
Open the subdomain in a private browser window or on your phone with Wi-Fi off — your own PC may hold an old cached answer
Confirm the page shown is really from the second server (put a tiny test change in its folder and see it appear)
Re-open your main website. It should be untouched — if it changed, you edited the wrong record; undo and redo carefully
🔴 The symptom tells you which side failed. Browser says the site “cannot be reached” or NXDOMAIN — that is side one (DNS). You reach a page but it is the server's default or the wrong site — that is side two (the server does not know its name). Do not fix the healthy side.
🎥 See a Subdomain Pointed at a Server Live
The video demonstrates pointing subdomains at servers for dashboards, home servers and NAS access — both sides of the setup.
Will moving a subdomain affect my main website or email?
No — DNS changes are per record. Adding a record for shop.example.com does not touch the records for your root domain, www or your MX (email) records. Just be careful to add a new record rather than editing an existing one.
The subdomain shows my hosting provider's default page. What is wrong?
Your DNS side is actually working — the visitor reached the second server. The server has not been told to serve shop.example.com, so it shows its default page. Add the subdomain in the second server's panel as its own website and put files in its folder.
Can the second server be in another country or company?
Yes. There is no rule connecting a subdomain to the main site's host, city or provider. Each record points wherever you tell it — one of the main reasons subdomains are so useful.
This guide is based on the Technical Anshu Cloudflare subdomain tutorial video • Stuck on a step? Ask in the video comments — you will get a reply 🙏