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.

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

Try it on your domain

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