Pointing a Subdomain to a Different Host Than Your Main Domain

A marketing site on the bare domain and an app on a subdomain, built on completely different platforms, is one of the most common DNS setups — and the one restriction that trips people up is specific to the apex, not the subdomain.

A Common Setup

example.com hosted on one platform for the marketing site, app.example.com hosted somewhere entirely different for the product itself — two unrelated hosts, one domain.

One zone, several hostsexample.comyour DNS zone@ → A 203.0.113.80main websiteshop → CNAME shops.myshopify.comonline storedocs → CNAME example.gitbook.iodocumentation
Each name in the zone can point to a different provider; only the apex is limited to A records or ALIAS.

CNAME vs. A Record at a Subdomain

A subdomain can use a CNAME pointing at any hostname, on any provider — there's no restriction here. This is what makes the scenario above straightforward: app points at whatever hostname the app's hosting platform gives you.

Why the Apex Is Different

RFC 1034 forbids a CNAME from coexisting with other records at the same name, and the apex always needs NS and SOA records — so the bare domain can't be a CNAME the way a subdomain can. This is why the apex typically needs an A record (or a provider-specific workaround like ALIAS, ANAME, or CNAME flattening) instead of simply pointing at a platform's hostname the same way app.example.com does.

Why DNS Delegation Usually Doesn't Move

Even with subdomains scattered across different hosts, the domain's nameservers — set once, at the registrar — usually stay with a single DNS provider. Delegating a subdomain to entirely separate nameservers is possible via its own NS records, but it's rarely needed just to point that subdomain at different hosting; a CNAME or A record in the existing zone is enough.

The Actual Setup

A CNAME record for the subdomain, pointing at the hostname the hosting platform provides, alongside an A record (or apex workaround) for the bare domain pointing at the main site's host — both living in the same DNS zone, at the same provider.

Check How a Subdomain Resolves

Frequently asked questions

Can I point a subdomain to a completely different hosting provider than my main domain?

Yes — a subdomain can use a CNAME record pointing at any hostname on any provider. There is no restriction here, unlike at the apex domain.

Why can't I use a CNAME record at the root/apex domain?

RFC 1034 forbids a CNAME from coexisting with other records at the same name, and the apex always needs NS and SOA records — so a plain CNAME at the bare domain isn't valid. An A record, or a provider-specific workaround like ALIAS or ANAME, is used instead.

Do I need to change nameservers to add a subdomain pointing elsewhere?

No — adding a CNAME or A record for a subdomain in your existing DNS zone is enough. Changing nameservers is only needed if you want to delegate that entire subdomain to a separate set of nameservers, which this scenario doesn't require.

Try it on your domain

See the theory in practice — run a CNAME Lookup for your own domain.