问题
I am trying to figure out how to point my domain, which is registered with 123-reg to my heroku app.
Currently, when I check whether the steps I have taken have worked, I get an error that says:
Host www.example.com not found: 2(SERVFAIL)
Heroku has instructions for GoDaddy. I use 123-reg. 123-reg don't have any support for heroku but they do have instructions for adding CNAME records to my DNS. I've followed them.
I made three CNAME entries (and removed all A records as it appears that Heroku does not accept them).
www
CNAME www.example.com.
www
CNAME example.com.
www
CNAME rainbow-mutiny-636...
All CNAME records have the trailing "."
Can anyone help with instructions for how to get started with 123-reg domain name configuration for heroku?
回答1:
The first issue is that you have conflicting CNAME entries. Start by removing all CNAME entries where the hostname is "www".
Then create one new CNAME entry. The hostname field should be "www" and the Destination CNAME should be your Heroku app hostname "rainbow-mutiny-636.herokuapp.com".
Now go to your Rails app directory and run heroku domains
in the terminal. If you've previously set it up properly you should see something like:
Domain Name DNS Target
───────────────────────── ─────────────────────
www.example.com rainbow-mutiny-636.herokuapp.com
If you don't see this entry, then create it by running:
heroku domains:add www.example.com
And that's it. Once the DNS changes have propagated http://www.example.com
should point to your Heroku app.
来源:https://stackoverflow.com/questions/39926476/rails-heroku-configuring-123-reg-domain-for-heroku