0
votes

I can't configure my DNS in order to redirect my root domain to www.domain for a Heroku app.

I'm using Vultr's DNS. The problem is Heroku does not provide IP address so I can't add an A record, nor a CNAM record to redirect root to www (source):

DNS A-records require that an IP address be hard-coded into your application’s DNS configuration. This prevents your infrastructure provider from assigning your app a new IP address on your behalf when adverse conditions arise and can have a serious impact to your app’s uptime.

A CNAME record does not require hard-coded IP addresses and allows Heroku to manage the set of IPs associated with your domain. However, CNAME records are not available at the zone apex and can’t be used to configure root domains.

Here is my DNS configuration: enter image description here

Thus, the SSL certificate fails in Heroku: enter image description here

My question is: how can I easily redirect the root domain of my Heroku app to www.domain.com?

Thanks.

1
Providers which support CNAME-like functionality are listed in the Custom Domains article.Dusan Bajic
Can't I do it with Vultr? I'm managing all my domains with their DNS, I would prefer to keep everything at the same place.nico_lrx
You should then probably ask them, but don't get your hopes up.Dusan Bajic

1 Answers

0
votes

ping with the DNS target you have got from Heroku. you will get the IP for that. Use that as Dns targe in vultr. worked for me.

example:

➜  ~ ping botletter.com.herokudns.com
PING botletter.com.herokudns.com (3.212.117.40): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1

Here use 3.212.117.40 IP in vultr DNS target