User is having trouble pointing their root domain (aka apex domain/naked domain) to their Heroku app, either with setting the right DNS records, or accessing it over HTTPS.
Root domains on Heroku require the use of "CNAME-like" records, often referred to as ALIAS or ANAME records.
Unfortunately, a number of popular DNS hosts such as GoDaddy, Bluehost, and others do not support these types of records. Instead they tend to offer the following:
- A records
- URL redirects / forwarding
There are caveats with both of these options, as discussed below:
A records: A records will not suffice for pointing your root domains to Heroku because they require a static IP. These records have serious availability implications when used in environments such as on-premise data-centers, cloud infrastructure services, and platforms like Heroku. Since Heroku uses dynamic IP addresses, its necessary to use a CNAME-like record (often referred to as ALIAS or ANAME records) so that you can point your root domain to another domain.
The easiest alternative to an A record on these types of DNS hosts is the next option:
URL redirects / forwarding: Since A records won't work with Heroku, many users choose to redirect traffic from their root domain to a subdomain, such as
example.com > www.example.com.
The URL redirect / forwarding option only works for non-SSL requests. This means that:
- Requests to
http://example.comwill successfully be redirected
- Requests to
https://example.comwill fail with an SSL error.
If you need to support SSL on your root domain you will need to switch to a DNS host that supports CNAME-like records (often referred to as ALIAS or ANAME records). We have a list of ones you could use here: https://devcenter.heroku.com/articles/custom-domains#add-a-custom-root-domain