Reputation: 833
I'm new to using Heroku so I'm a bit confused because I initially had my website hosted on GoDaddy, but when I added node to my web app I switched to Heroku.
So what is happening is when I visit my website using www. it goes to the correct, updated site, however, when I try the naked route it takes it to the older version of the website. I figured since it's still showing the older site with the naked route that there was a problem on GoDaddy, therefore, I updated one page on GoDaddy and sure enough, the page is updated via the naked route now.
That leads to my first question. If my website is now on Heroku, does it still need to be hosted on GoDaddy as well? Additionally, if the first question is yes, then how do I set up the naked route to point to the same site as the www. route?
I've already have the host as www with the 'points to' pointing to the Heroku domain name but still getting the problem above. This is why I believe the problem lies with the hosting on GoDaddy.
Upvotes: 2
Views: 4113
Reputation: 55
This is what helped me as of 2019. First, get to the list of your domain(s) on GoDaddy's interface. You'll see something like this:
Choose your domain. Once you're on your domain's settings, scroll to the bottom and click on 'Manage DNS'. You should see some records created, if there are any.
ACTUAL CONFIGURATION
FIRST STEP: Create a CNAME record(there should be an 'add' button somewhere). The record should have the following parameters - Type - CNAME, Host - www, Points to - enter the link heroku created for your app.
creating a CNAME record on GoDaddy's
Sometimes when there are other old CNAME records, it'll throw an error. Erase old CNAME records and try again.
SECOND step: Go to your terminal and enter the command 'host www.yourdomain.com'. If the CNAME record was successful, you should see the heroku domain you enter earlier. IMPORTANT - You should also see a bunch IP addresses which we will need.
THIRD step: Create 'A' records for all the IP addresses provided on the 'host www.yourdomain.com' terminal command. They should have the following parameters: Type - A, Host - @, Points to - IP address, choose TTL custom and type 600 seconds.
This should do it
Upvotes: 3
Reputation: 3005
You don't need to host a copy of your site at Goddady.
In Godaddy, you must have a CNAME www pointing to heroku:
or
To use heroku for your naked domain, you can define a redirection for the naked domain to your www:
Go to My domains (https://dcc.godaddy.com/manage/)
Click on Manage connection
Set forwarding option (choose www.your_application_name.com, forward type permanent)
Upvotes: 4