Built on Y Build Build this app yourself — prompt to deployed, on your own domain. Start free
BuildShipCompareThe LabAbout Start building →
Ship

Custom domains & HTTPS without touching DNS

The handful of records that matter, the order to add them, and why the apex needs a different trick than www. Do it once, understand it forever.

Y Build EditorialProduct documentation team
Published May 19, 2026
6 min
read
cover · 1200×600

Custom domains scare people off for no reason. There are only a few records that matter, a sane order to add them in, and one apex gotcha that trips up everyone the first time. Learn it once and you’ll never think about it again.

The shape of it

Every modern host — Cloudflare Pages, Vercel, Netlify — works the same way: add the domain in the dashboard (it shows “pending”), point a DNS record at the host’s target, and the host provisions the TLS certificate for you, automatically. No nginx, no certbot, no copying cert files around.

The host’s target is just a hostname you point at:

HostPoint your record at
Cloudflare Pagesyour-project.pages.dev
Vercelcname.vercel-dns.com
Netlifyyour-site.netlify.app

The order that works

  1. Add the domain in the host dashboard first, so it knows to expect it.
  2. www is easy — add a CNAME from www to the host target above.
  3. The apex is the gotcha. You cannot put a raw CNAME on the bare domain (example.com) — it’s against the DNS spec. Use your DNS provider’s CNAME flattening (Cloudflare does this automatically) or an ALIAS / ANAME record instead.
  4. Pick a canonical — redirect www → apex or apex → www, not both live. One home, one URL.
  5. Wait for validation, then confirm it resolves over HTTPS before you celebrate. The certificate usually lands within minutes.

The two things people forget

  • Apex vs www — set up both, then redirect one to the other. Skipping this is why example.com works but www.example.com throws a cert error (or the reverse).
  • Email shares the domain — your app on example.com and email on the same domain coexist fine; just don’t delete the MX records while you’re in there.

Bottom line

It’s a 10-minute job, not a DevOps project: add the domain, one CNAME for www, flattening/ALIAS for the apex, pick a canonical, confirm HTTPS. The certificate is the host’s problem now — which is exactly how it should be. Got the app but not the domain yet? That’s the whole deploy path.

References

Liked this teardown?
Get the next experiment the day it drops. One email a week, raw numbers included.
Written by
Y Build Editorial Product documentation team

Maintained by the Y Build team. Technical claims are reviewed against linked primary documentation, and material limitations are stated in the article.

Author · The Lab
More from Y →

Keep reading

All of The Lab →
Build your own app
Free · no card
Start free →