TapTapDNS

DNS record design

CNAME record vs. A record for SaaS custom domains

Most SaaS products ask customers to point a subdomain such as app.customer.com or docs.customer.com using a CNAME record rather than a raw IPv4 A record. That single choice prevents broken mail routing, supports edge failover, and simplifies customer onboarding.

What each record actually maps

An A record maps a hostname directly to a 32-bit IPv4 address such as 192.0.2.44. If your load balancer changes IPs during maintenance or moves between regions, every customer with a hardcoded A record stops resolving until they edit their zone manually.

A CNAME record maps a subdomain alias to another hostname you control, such as edge.yourapp.com. When your edge rotates IP addresses or adds new PoPs, you update edge.yourapp.com once and customer domains follow automatically.

Comparison of CNAME, ALIAS, and A records for SaaS custom domains
Record typeValid at zone apexFollows provider IP changesBest SaaS onboarding fit
CNAMENo (RFC conflict with SOA/NS/MX)YesSubdomains (www, app, docs, portal)
ALIAS / ANAME / CNAME flatteningProvider-specific onlyYes, resolved by authoritative DNSApex domains on Cloudflare, DNSimple, or Route 53
A / AAAAYesNo (static IP addresses)Apex domains on registrars without flattening

Why CNAME records fail at the domain apex

Per DNS rules in RFC 1034 and RFC 1912, a CNAME record cannot coexist with other record types at the same hostname. Because a root domain such as example.com already carries mandatory SOA and NS records, and usually carries MX and TXT records for email, adding a standard CNAME at @ is rejected by compliant DNS hosts or breaks incoming mail.

How providers work around the apex constraint

Some DNS providers offer non-standard CNAME flattening (Cloudflare), ALIAS (DNSimple), or ANAME records that look up your target hostname and synthesize A/AAAA answers at query time. Registrars without flattening still require static A records or an HTTP redirect from the apex to www.

Common conflicts during SaaS onboarding

  • Leftover A or AAAA records on the same host: If a customer previously pointed www.example.com to a parked page, adding a CNAME fails until the existing A/AAAA records on www are removed.
  • Double-appended zone suffix: Entering docs.example.com in a registrar UI that expects only docs creates docs.example.com.example.com.
  • Overlong TTLs before migration: Existing records with a 24-hour TTL stay cached on recursive resolvers even after authoritative DNS changes.

In TapTapDNS, the customer previews the exact record plan before applying edits, and authoritative DNS verification checks the live nameservers rather than trusting cached local lookups. See the developer integration guide for how templates bind hostnames in POST /v1/connect-sessions.