24

I have a Heroku app and I've add a CNAME (www to herokuapp) to redirect it from GoDaddy to Heroku. Now I'm trying to manage also the naked domain.

This is from Heroku documentation.

Naked domains (also known as bare domains or apex domains, for example mydomain.com) must use DNS A-records. To setup your root domain, add separate A records for each of the following addresses using your DNS management tool:

75.101.163.44
75.101.145.87
174.129.212.2

Check that your DNS is configured correctly with the “host” command:

$ host example.com
example.com has address 75.101.163.44
example.com has address 75.101.145.87
example.com has address 174.129.212.2

I've also activated the forwarding from the GoDaddy main menu.

Ok, if I try host example.com with my domain, all is ok. But, when I try with the browser, I get this:

Heroku | No such app There is no app configured at that hostname. Perhaps the app owner has renamed it, or you mistyped the URL

I tried also with the command heroku domains:add yourdomain.com but this create a second instance of my app, it doesn't redirect it to the full domain www

Chris van Chip
  • 504
  • 4
  • 20
parov
  • 1,077
  • 4
  • 12
  • 22
  • The "No Such App" error is essentially heroku's way of saying "404". It probably means you mistyped your app domain. – OneChillDude Nov 20 '12 at 16:52

1 Answers1

22

Heroku highly advises against using A-records to point domains at cloud apps. Using A-records increases the chance of instability for DNS resolution. Heroku goes into details here.

Instead, you should redirect your naked domain to the 'www' subdomain. You can refer to this SO thread for more details on how to set that up on GoDaddy.

Community
  • 1
  • 1
redhotvengeance
  • 27,446
  • 10
  • 49
  • 54
  • 3
    In the past year I've applied this method (pointing A Records to Heroku cloud instance IPs) several times, and my experience is that Heroku changes the instances every few months. So highly discouraged in production. – wspruijt Jan 05 '15 at 09:36
  • @wspruijt My answer advises against pointing A-records at Heroku IPs. – redhotvengeance Jan 05 '15 at 09:44
  • 1
    @redhotveneance And I agree, just wanted to add that Heroku does really change these IPs. I also stumbled upon a possible solution to this here: http://blog.dnsimple.com/2011/11/introducing-alias-record/ – wspruijt Jan 05 '15 at 10:50
  • 2
    this does not work with HTTPS domains https://kb.heroku.com/why-am-i-seeing-a-certificate-mismatch-error-when-i-access-my-custom-domain-over-ssl-tls – BishopZ Oct 10 '16 at 21:38
  • 13
    Using GoDaddy forwarding service does not work with HTTPS like @bishopz says. `https://root.com` won't redirect to `https://www.root.com`. The only thing that works is `http://root.com` to `http://www.root.com`. It's only a partial solution. The question is Why is it happening only for HTTPS not HTTP. – Yonk Mar 24 '17 at 02:01
  • 4
    Jumping on the bandwagon - it is not possible to forward or configure root domain with HTTPS solely with GoDaddy. GoDaddy does not support CNAME on the root domain, therefore you're left with only the option of forwarding to www. The reason, @Yonk, that it won't work for HTTPS is because GoDaddy does not have a cert for the root domain (they don't even have port 443 available for it). When a user tries to hit the root domain over SSL/TLS (port 443), it just spins. Only solutions at this time seem to be: - Change DNS solution - i.e. Route53 - Point root to a intermediary server - nope – togume Nov 05 '17 at 01:45
  • Root domains on Heroku indeed require the use of ALIAS ANAME or FLATTENING records which is not possible with GoDaddy. Heroku itself also recommends to either: 1. Not use a naked domain and just use your www sub domain 2. Redirect/ Forward your HTTP root domain to your www sub domain. This won't work for your HTTPS root domain though 3. Use an Alternate DNS Provider. Heroku recommends the following: https://help.heroku.com/NH44MODG/my-root-domain-isn-t-working-what-s-wrong – Ruben Portz Oct 17 '20 at 21:26
  • God damn, this Heroku policy is beyond ridiculous. I have a country specific domain and there is no way that I can redirect from the naked domain to Heroku. Yes, it works until you're buying your domains on GoDaddy. – Branislav Lazic Jun 21 '23 at 16:41