Opens in a new tab

Connect a domain to Heroku: the DNS records

Heroku has no fixed IP address, so the root needs an ALIAS, ANAME or flattened CNAME — not an A record — to the DNS target Heroku gives each domain, and www a CNAME to its own target. The targets end in herokudns.com; never point at your-app.herokuapp.com if you want HTTPS.

The records to add

NameTypeValue
@ALIAS / ANAME / flattened CNAMEwhispering-willow-5678.herokudns.com (your own target)
wwwCNAMEexample-12345.herokudns.com (your own target)

Each custom domain gets its own target, shown by heroku domains or in the app’s settings. Private Spaces use herokuspace.com targets.

A recordsNot possible — Heroku’s addresses change
IPv6Not supported by Heroku’s certificates
CertificateLet’s Encrypt (Automated Certificate Management)

Check your domain

Enter your domain: we look up its records and compare them with what Heroku expects — the root, www, and any record left over from before.

Step by step

  1. Add each domain to the app (heroku domains:add, or in the app’s settings) and note its DNS target.
  2. At your DNS host, point the root at its target with an ALIAS, ANAME or flattened CNAME, and www at its target with a CNAME.
  3. Turn on Automated Certificate Management.

What to remove

  • A records on the root, and CNAMEs to your-app.herokuapp.com — those work only without HTTPS.

The certificate

Heroku’s Automated Certificate Management uses Let’s Encrypt and renews a month before expiry. It fails with a CNAME to herokuapp.com, with DNSSEC that does not validate, with CAA that excludes Let’s Encrypt, and behind Cloudflare, which Heroku recommends against with it.

Common mistakes

  • An A record at the root.
  • A CNAME to herokuapp.com instead of the herokudns.com target.
  • Deleting the app without removing the DNS records — the name can then be taken over.
  • A wildcard DNS record without the wildcard added to the app.

Sources

Records checked on 26 September 2026 against these official sources:

Know the moment your site stops answering

Add your site and we check it every few minutes, confirm a failure from another location — Europe, North America or Asia — before calling it down, and email you when it stops answering and when it is back. Free for two sites.

Create a free account