How to Set Up a Custom Domain

You bought a domain. Now you need it to point at a hosting platform — static site host, Heroku, a VPS, whatever. The DNS setup is the same shape regardless of where you're hosting.

The five records most sites need

  1. A or CNAME at root. Points example.com at the hosting provider. A record for an IP; CNAME for a hostname (and CNAME-at-root is supported by Cloudflare, Route 53, and some others — not RFC-strict but widely tolerated).
  2. A or CNAME at www. Points www.example.com at the same place, or 301-redirects to root.
  3. MX if you're receiving mail.
  4. TXT for SPF if you're sending mail.
  5. CAA for security (optional but recommended).

Verification

After setting records, wait a TTL cycle and run DNS Propagation Checker to confirm the change is live across resolvers. Then run the full audit — it'll flag any missing email or TLS records.

Frequently asked questions

Do I need both A and CNAME records?

Usually one or the other at each hostname. A record for an IP; CNAME for a target hostname. CNAME at root is technically against RFC but widely supported.

How long until my domain works?

DNS records propagate within the TTL window — usually 5-60 minutes. Browsers may cache the old (failing) lookup for a few minutes longer.

Get one fundamentals article a week

DNS, IPs, email deliverability, TLS — explained for sysadmins and curious developers. No spam, unsubscribe in one click.