I am trying to get an SSL certificate on my custom domain on Heroku and the last thing it told me to do is add the following records:
Domain Record Type DNS Target
─────────────────── ─────────── ─────────────────────────────────
www.gethomesync.com CNAME www.gethomesync.com.herokudns.com
gethomesync.com ALIAS/ANAME gethomesync.com.herokudns.com
But my domain registrar GoDaddy doesn't have an option to add ALIAS or ANAME. I don't know much about DNS having only done quite basic tasks as and when I've needed them, is there an equivalent to ALIAS/ANAME that I can use through GoDaddy?
Thanks
ANAME, also called ALIAS, is a domain record type that can be used in place of a CNAME record. It's available from domain name companies such as Namecheap, GoDaddy, Hostinger, Google Domain, and more. ANAME was born out of the combination of CNAME and another record type called A.
Understanding the differencesThe CNAME record maps a name to another name. It should only be used when there are no other records on that name. The ALIAS record maps a name to another name, but can coexist with other records on that name.
ANAME records are alias records that allow you to map the apex (root record) or any other record within your domain to a target host name.
Google Domains doesn't support ANAME/ALIAS records. For DNS providers that don't have ANAME/ALIAS support, we strongly recommend migrating your DNS to Amazon Route 53. For more information, see Configuring Amazon Route 53 as your DNS service.
You don't need to set up ALIAS/A record, just create a CNAME record pointing to gethomesync.herokussl.com
(you can check the endpoint name with heroku certs
Heroku Documentation):
Type Name Value
CNAME www gethomesync.com.herokudns.com
To create a naked domain (removes the need to write www) you need to forward your gethomesync.com
to wwww.gethomesync.com
:
Under Forwarding click on Domain -> 'Manage' -> then click 'Add Forwarding'
'Forward to' should be wwww.gethomesync.com
(your domain)
'Redirect type' should be '301
'Forward settings' should be 'Forward only'
A warning here. As pointed by @NikitaAvvakumov and @deviant in some comments, the accepted answer is not correct.
As mentioned in Heroku docs,
Root domains on Heroku require the use of "CNAME-like" records, often referred to as ALIAS or ANAME records.
Without these records,
Requests to https://example.com will fail with an SSL error.
Again, even if you choose to redirect from your root domain to a subdomain (ex: from example.com
to www.example.com
), it will only work for non-SSL requests. Any request to https://example.com will fail with an SSL error.
A simple solution to that would be to use another DNS host. For example, I use CloudFlare (the free plan is more than enough and offers great features) which uses what is called CName flattening
that works with Heroku like having an ALIAS (they use this by default - you don't have to do anything else than configuring your nameservers and adding DNS records. You can check both Heroku and CloudFlare for tutorials - it's pretty easy).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With