105

I have created a heroku application and wants to give domain to it from godaddy.com.

I have configured all three hosts provided by heroku but now I am getting error saying:

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 want to know: is there any other way to configure a heroku app?

UPDATED : New Approach Please use this link for new approach . Accepted answer is old feature.

Arpit Vaishnav
  • 4,739
  • 6
  • 39
  • 57

7 Answers7

83

There are 2 steps you need to perform,

  1. Add the custom domains addon and add the domain your going to use, eg www.mywebsite.example to your application
  2. Go to your domain registrar control panel and set www.mywebsite.example to be a CNAME entry to yourapp.herokuapp.com assuming you are using the CEDAR stack.
  3. There is a third step if you want to use a naked domain, eg mywebsite.example when you would have to add the IP addresses of the Heroku load balancers to your DNS for mywebsite.example

You can read more about this at http://devcenter.heroku.com/articles/custom-domains

At a guess you've missed out the first step perhaps?

Following the announcement of Bamboo's EOL proxy.heroku.com being retired (September 2014) for Bamboo applications so these should also now use the yourapp.herokuapp.com mapping now as well.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
John Beynon
  • 37,398
  • 8
  • 88
  • 97
  • 11
    custom domains are now a core feature, so no add-on installation step. – ob1 Jun 04 '12 at 08:06
  • 8
    The CNAME should be set to "[your app].herokuapp.com" (for the Cedar stack, for bamboo use "[your app].heroku.com") – ob1 Jun 04 '12 at 08:07
  • 13
    @JohnBeynon Still would be worthwhile editing your answer, since people are coming to here from Google. *cough* – Josh Smith Nov 04 '12 at 23:33
  • This answer doesn't apply anymore – Adam Waite Nov 30 '12 at 13:30
  • 3
    If you need to redirect your naked domain (example.com) to your heroku app you can use http://wwwizer.com/naked-domain-redirect – Gabriel Cebrian Sep 21 '13 at 02:16
  • There are more options for naked domains here too: https://devcenter.heroku.com/articles/custom-domains#cname-functionality-at-the-apex. Some DNS providers also provide a "Heroku service" that appear to set it up for you, e.g. https://iwantmyname.com/services/developer/heroku-cloud-hosting-custom-domain – poshaughnessy Mar 27 '14 at 18:13
  • 1
    Please take into account that starting *September 22nd 2014*, Heroku is only supporting `[yourapp].herokuapp.com`. Support for the legacy routing stack `[yourapp].heroku.com` will be dropped. – Gabriel Osorio Jun 10 '14 at 13:15
  • this is not their offical blog said to put to domain of your app..it said to put it to proxy.heroku.com instead which didn't work...then began another scavenger hunt...do devs spend over fifty percent of their time on scavenger hunts? – Muhammad Umer Jul 17 '14 at 20:35
  • What if I performed both steps and still get the same error? DNS entry confirmed with host, app config confirmed with heroku domains. What else can I do? – piccolbo Nov 08 '15 at 01:45
  • 1
    A few hours later, it started working with no further intervention. Real time. – piccolbo Nov 08 '15 at 07:23
76

I used this videocast to set up my GoDaddy domain with Heroku, and it worked perfectly. Very clear and well explained.

Note: Skip the part about CNAME yourdomain.example. (note the .) and the heroku addons:add "custom domains"

http://blog.heroku.com/archives/2009/10/7/heroku_casts_setting_up_custom_domains/


To summarize the video:

  1. on GoDaddy and create a CNAME with

    Alias Name: www
    Host Name: proxy.heroku.com
    
  2. check that your domain has propagated by typing host www.yourdomain.example on the command line

  3. run heroku domains:add www.yourdomain.example

  4. run heroku domains:add yourdomain.example

It worked for me after these steps. Hope it works for you too!

However, things have changed. Check out this post: Heroku/GoDaddy: send naked domain to www

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
Alexandre
  • 2,073
  • 4
  • 21
  • 24
  • 1
    Good post. This is end to end what you need. I was about to post this link. – adu Oct 25 '12 at 09:15
  • 1
    I'm new to webdev, so sorry if this question is a little elementary, but do I keep or delete the default CNAME with alias `www` and host name `@`? Edit: Oops, seems like only one can exist. – pqn Aug 26 '13 at 04:13
  • 1
    As of February 2019, this does not work and GoDaddy will keep any fees you paid them regardless unless you demand a refund very early on. Heroku does keep a list of recommended DNS providers. More on this here: https://devcenter.heroku.com/articles/custom-domains – Matt West Feb 05 '19 at 18:57
16

The trick is to

  1. create a CNAME for www.myapp.example to myapp.heroku.com
  2. create a 301 redirection from myapp.example to www.myapp.example
Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
Jonathan Roy
  • 903
  • 11
  • 20
8

I struggled a lot to resolve it Nothing seemed to work for me.

The steps I followed are mentioned here.

  1. Go to your App settings.

  2. Click on Add domain.

  3. A dialog will open & will ask you to enter the desired domain. (Please add it starting with www for instance - www.abcd.example )

  4. One added click on Next to move to the next dialog.

  5. After adding the domain you will get the DNS target, Now you need to navigate to GoDaddy and follow the following steps.

  6. Navigate to https://dcc.godaddy.com/domains & click on your domain.

  7. Once clicked you will navigate to https://dcc.godaddy.com/control/yourdomain/settings

  8. Scroll down to the bottom you will see Manage DNS.

  9. It will navigate you to DNS settings then add the entry similar to mentioned below and delete all other CNAME records. Here the value of points is your DNS target that you got in the 4th Step.

  10. Then after some time your site should be mapped to the Heroku app URL.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
Divyanshu Rawat
  • 4,421
  • 2
  • 37
  • 53
6

Yes, many changes at Heroku. If you're using a Heroku dyno for your webserver, you have to find way to alias from one DNS name to another DNS name (since each Heroku DNS endpoint may resolve to many IP addrs to dynamically adjust to request loads).

A CNAME record is for aliasing www.example.com -> www.example.com.herokudns.com.

You can't use CNAME for a naked domain (@), i.e. example.com (unless you find a name server that can do CNAME Flattening - which is what I did).

But really the easiest solution, that can pretty much be taken care of all in your GoDaddy account, is to create a CNAME record that does this: www.example.com -> www.example.com.herokudns.com.

And then create a permanent 301 redirect from example.com to www.example.com.

This requires only one heroku custom domain name configured in your heroku app settings: www.example.com.herokudns.com. @Jonathan Roy talks about this (above) but provides a bad link.

Brane
  • 3,257
  • 2
  • 42
  • 53
BoiseBaked
  • 792
  • 7
  • 15
2

You can't use the naked domain of your-domain.com if it is not redirected to the www.your-domain.com. Heroku use the www.yourdomain.com which act here as a subdomain. So when you follow the default instruction to use your-domain.com then you will need to assign both of them.

We can actually assign only the naked domain without the www.your-domain.com. Use only your-domain.com when the domain's dns provider (NameServers) support ALIAS or ANAME for the @ Record to example.herokuapp.com without CNAME www.your-domain.com to it.

It will let you to point www.your-domain.com to other hosting separately (independent).

Community
  • 1
  • 1
eQ19
  • 9,880
  • 3
  • 65
  • 77
0

I pointed the non-www to 54.243.64.13 and the www.domain.com to the alias.herokuapp.com and all worked nicely.

Found the IP only after pointing www.domain.com and then running the dig command on the www.domain.com and it showed:

;; ANSWER SECTION:
www.domain.com. 14400  IN      CNAME   aliasat.herokuapp.com.
aliasat.herokuapp.com. 300 IN CNAME us-east-1-a.route.herokuapp.com.
us-east-1-a.route.herokuapp.com. 60 IN  A       54.235.186.37

;; AUTHORITY SECTION:
herokuapp.com.          900     IN      NS      ns-1378.awsdns-44.org.
herokuapp.com.          900     IN      NS      ns-1624.awsdns-11.co.uk.
herokuapp.com.          900     IN      NS      ns-505.awsdns-63.com.
herokuapp.com.          900     IN      NS      ns-662.awsdns-18.net.

May not be ideal but worked.

Brane
  • 3,257
  • 2
  • 42
  • 53
  • 1
    Your website may go down periodically if you use this solution. The IP may be changed (and it will) which will kill your A record DNS setup. You will have to do this every 2-3 months or after any outage at Heroku. We've been dealing with this and are finally moving over to cloudflare or easyDNS to prevent this. – David Nelson Aug 04 '17 at 15:42