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.
A DNS Provider does not allow setting
Root domains on Heroku require the use of
Unfortunately, a number of popular DNS hosts such as GoDaddy, Bluehost, Google Domains, OVH, Hostinger and others do not support these types of records. Many of these Providers will tell you there is no such thing as
FLATTENING Records and many of these providers will tell you to set an
A Record instead, however;
ARecords do not work with Heroku for routing
ARecords require static IP Addresses and static IP Addresses do not work with Heroku for routing, because Heroku (and many other cloud platforms) use dynamic IP's.
If your DNS Provider doesn't allow you to set
FLATTENING Records, there are several options available for you to get your domains working with Heroku.
1. Do not use a Root Domain
This is the easiest solution. Root domains are technically not needed as long as you have a custom domain with subdomain set up. For example, you have a site with two domains; the root domain
example.com, and the sub domain
www.example.com. In this case, as long as you have
www.example.com set up,
example.com isn't needed as users can reach your site via
www.example.com and to set up
www.example.com you need to use
CNAME Records which all DNS Providers allow you to set.
2. Redirect/ Forward your root domain to your sub domain
Many users choose to redirect traffic from their root domain to a subdomain, EG: redirect/forward
example.com > www.example.com.
However: 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.
3. Use an Alternate DNS Provider
The following are DNS Providers we recommend that do allow for setting
FLATTENING records. Many of these DNS Providers will have guides on how to work with Heroku. Eg, using Flattening with Cloudflare