nico_lrx
nico_lrx

Reputation: 280

DNS redirection from root domain to www for a heroku app

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.

Upvotes: 0

Views: 960

Answers (1)

Nurul Huda Robin
Nurul Huda Robin

Reputation: 149

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

Upvotes: -1

Related Questions