Why isn't my domain pointing to my heroku rails app? - ruby-on-rails

I ran heroku domains:add www.samstil.es and heroku domains:add samstil.es, and my CNAME aliases area of my domain registrar looks like this: registrar http://puu.sh/4Kpib.png
Shouldn't I be able to go to http://samstil.es/ right now, and have it show my rails welcome page?

I walked this same path just yesterday and the only way I found to fix this was using the IP number instead of the app.herokuapp.com path. I just triggered a ping samstil-es.herokuapp.com from my terminal and used that IP.
Give it a try, hope that helps, worked for me in name.com.

Related

Rails - Configuring DNS to host with Heroku (123-reg)

I am trying to figure out how to publish my app on heroku. My DNS is with 123-reg. 123-reg does not provide any support for heroku deployment and vice versa.
I have previously asked this question (voted down and mocked in the comments)
Rails, Heroku - configuring 123-reg domain for heroku
I'm asking again in the hope of finding some substantive help on how to get this working.
Currently, when I try to render the page using my custom domain name, I get an error that says:
This site can’t be reached
www.mydomainname.com ’s server DNS address could not be found.
Try running Network Diagnostics.
DNS_PROBE_FINISHED_NXDOMAIN
When I try the following in the terminal, I get the responses noted below:
host www.mycustomdomainname.com
Host www.mycustomdomainname.com not found: 3(NXDOMAIN)
host https://www.mycustomdomainname.com
Host https://www.mycustomdomainname.com not found: 2(SERVFAIL)
dig www.mycustomdomainname.com cname +short
myherokualias.herokudns.com
heroku domains returns the heroku alias both with and without the www prefix.
In my DNS, I have a CNAME record with:
DNS ENTRY TYPE PRIORITY TTL DESTINATION/TARGET
www CNAME mycustomdomainname.herokudns.com.
Apart from that I have MX and TXT records for my email account.
Can anyone see what I need to do to get the page to render using my custom domain name?
When I try:
curl -vI https://www.mycustomdomainname.com
* Rebuilt URL to: https://www.mycustomdomainname.com/
* Could not resolve host: www.mycustomdomainname.com
* Closing connection 0
curl: (6) Could not resolve host: www.mycustomdomainname.com
I'm lost for things to try to get this working
HEROKU SETTINGS
I can see from inspecting my heroku Production Check, that I have the following issues:
FAILED DNS configuration
Your DNS is not configured correctly. Your domain "mycustomdomain.com"'s ALIAS or ANAME record should point to ancient-water-74339.herokuapp.com.
However, it also says:
PASSED Heroku SSL
The Heroku SSL instructions say:
Change your DNS for all domains on your app
Verify your DNS settings by running dig www.yourdomainname.com cname +short. If it returns www.yourdomainname.com.herokudns.com then you have set it up correctly. If you are using an ALIAS or ANAME record, you can verify that based on the DNS provider. For instance, DNSimple will return a TXT record showing how your domain’s ALIAS is set-up.
You should note that it may take up to 24 hours before your DNS is fully propagated globally.
To me, that means I'm supposed to replace the reference to 'herokuapp' with a reference to 'herokudns'. Also, I am reading these instructions to require that I replace 'ancient-water-74339' with a 'mycustomdomainname'.
I have done this (as I understand the instructions) so that the CNAME on my DNS now points to 'mycustomdomainname'.herokudns.com.
The heroku production check says that this is incorrect. Am I supposed to have 2 CNAME records (one using the heroku alias.herokuapp) and another using 'mycustomdomainname'.herokudns?
I tried to use the LetsEncrypt_plugin gem for rails. I cannot verify whether there is an error in that config because that gem does not provide support for heroku.
Can anyone see what I'm supposed to do to get out of this configuration hell?
The heroku production check instructions for DNS with SSL give instructions to provision an SSL Endpoint. The SSL Endpoint instructions say they are only for legacy clients (I don't know what a legacy client is), but that page suggests using the Heroku SSL instead. Those instructions say to use 'herokudns.com' on the end of the app name.
I can't seem to get any combination of these instructions to work.
Checklist
On your DNS provider make sure your CNAME record is properly set:
Host: *
Points To: yourapp.herokussl.com
How to add a CNAME record in 123-reg
On Heroku go to 'Resources' and make sure you have the SSL add-on installed.
On Heroku go to 'Settings/Domains and certificates' and make sure you have your custom domains correctly set:
Domain Name: *.yourdomain.com
DNS Target: yourapp.herokussl.com
Please note the url on herokuapp.com and herokussl.com may differ. If you are using an SSL certificate you'll have to use the latter.
Gotchas
Using the heroku toolbelt make sure your SSL certificate is still trusted
heroku certs:info --app yourapp
Your registrar and your DNS provider may differ, this may lead you to be editing your CNAME records on the incorrect place.
To make sure you are at the right spot perform a whois on your domain:
whois yourdomain.com | grep 'Name Server'
If your domain is actually pointing to 123-reg, the output should be:
Name Server: ns1-123-reg.co.uk
Name Server: ns2-123-reg.co.uk
If the output is something else, then you probably should be setting your CNAME records elsewhere.
Hope this helps <3
After pointing your domain to Heroku app on your Heroku dashboard, go to settings tab and scroll down to custom domain. There click on ADD DOMAIN and add your custom domain.
According to your explanation, the CNAME record is set up correctly for the domain.
Please make sure the domain is added from the Heroku end properly. This guide may help you https://devcenter.heroku.com/articles/custom-domains

How to add subdomains in heroku in rails

I have an app in ruby on rails which have multiple subdomains which on localhost are like this
manager.daycare.no:3000/
worker.daycare.no:3000/
daycare.no:3000/
admin.daycare.no:3000/
parent.daycare.no:3000/
Now I want to add these on heroku. How I add these sub domains on heroku?
My heroku-app name is sufa-travels.herokuapp.com/
As I know, you cannot choose specific ports for configure your host in Heroku, also Heroku not supports DNS. But you can add custom domains and subdomains, and from your domain hosting settings, redirecting to Heroku app. Here is little shot from youtube Youtube
Heroku Doc says: Docs
$ heroku domains:add www.example.com`
Adding www.example.com to example... done
>
$ heroku domains:add blog.example.com`
Adding blog.example.com to example... done
You can add a subdomain by using the heroku domains:add command.
https://devcenter.heroku.com/articles/custom-domains#add-a-custom-domain-with-a-subdomain

Heroku app not found when URL isn't prefixed with www

I have a Rails app hosted on Heroku, and when I don't prefix the domain in the browser with the www, I get a no application found error. Like this,
<domain-name>.com
causes the error but
www..com works fine.
How can I remedy this?
Is your application setup to respond to <domain-name>.com? Check with $ heroku domains, do you see *.<domain-name>.com or <domain-name>.com there? Is DNS set to forward that domain to your Heroku app?

Original sub-domain of rails app to Heroku

I would like to set up original domain to Heroku. But I got stuck. Could you help me?
What I did is as follows;
①heroku domains:add www.example.com
②DNS setting
a www 75.101.163.44
a www 75.101.145.87
a www 174.129.212.2
③host www.example.com
and then I got this.
Host www.example.com not found: 3(NXDOMAIN)
Heroku suggests not to use naked domains because they're fragile.
You need to set up a CNAME domain to Heroku like this:
CNAME www your-app-name.herokuapp.com.
Remove the A records. Please see the rest of the docs here: https://devcenter.heroku.com/articles/custom-domains

Why doesn't Heroku show the default Rails page?

Following chapter (1) of the Ruby on Rails tutorial, I was able to successfuly push the application to "Heroku" using:
git push heroku master
But, when I open the website, I get a page with the following:
App crashed
This application is temporarily offline.
If you're the administrator of this app, please check your heroku logs for the backtrace.
Why is that? And, why don't I see the default Rails page?
Thanks.
In any situation where heroku gives you an error message in production, type heroku logs into your terminal. This will usually point you in the right direction.
http://docs.heroku.com/logs-exceptions
Also check your localhost and make sure you have migrated the database if one exists.
Are you able navigate to default local rails website at http://localhost:3000 and see the defaut site?

Resources