Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DNS Mystery in Heroku CNAME Redirection

I have something quite mysteriously not working in my DNS configuration :

  • My app is at : http://my-domain.herokuapp.com
  • I configured my-domain.com the following way :

    @ 10800 IN A 174.129.25.170
    www 10800 IN CNAME my-domain.herokuapp.com.
    

using wwwizer.

So, http://my-domain.com redirects to http://www.my-domain.com which CNAMEs to http://my-domain.herokuapp.com

Everything seems fine, but when I enter http://my-domain.com or http://www.my-domain.com, I get : Heroku | No such app error message.

So I tried this :

host http://www.my-domain.com
www.my-domain.com is an alias for my-domain.herokuapp.com.
my-domain.herokuapp.com has address 54.243.92.108

and

host http://my-domain.herokuapp.com
my-domain.herokuapp.com has address 184.72.248.52

I can't see where the problem is. WWWizer seems working fine, but it feels like CNAME hasn't refreshed since the herokuapp IP changed ...

Any tip would be super appreciated.

Thanks

like image 225
Augustin Riedinger Avatar asked Oct 21 '22 13:10

Augustin Riedinger


1 Answers

Thanks to @neil-middleton comment, I found the solution.

I did added earlier heroku domains:add my-domain.com

but did not for heroku domains:add www.my-domain.com

which is the one that matters here. (Though I left both in case)

So it seems heroku has its own internal DNS control when CNAME-ing *.herokuapp.com where it gets as an entry the heroku domains.

This is logical to avoid setting CNAME to an app one don't own.

like image 108
Augustin Riedinger Avatar answered Oct 25 '22 18:10

Augustin Riedinger