EDIT2: Waiting to see if my changes were successful.
EDIT: I reinstalled everything using the command line Zerigo install command (the original question was for manual setup). THe problem now: the custom domains I set up do not work properly. Visiting the custom domain simply returns an error in Chrome: "Oops! Google Chrome could not find www.myapp.com" even though the custom domain I added was "www.myapp.com?
I've been trying to set up a custom domain on my Cedar Heroku app by following instructions at https://devcenter.heroku.com/articles/custom-domains and https://devcenter.heroku.com/articles/zerigo_dns.
In the tutorial for setting up a domain on Zerigo, one of the instructions for adding a host is to add the IP address of the webserver. How do I go about finding this information? I'm having trouble finding any resource that helps me with this.
Am I supposed to be adding the IP address of my app at _.herokuapp.com? When I try to do a look up of this address, I never get a consistent address (probably because of Heroku's many servers). Any help is appreciated.
Linking Zerigo and Heroku is a three step process.
(1) Use the heroku addons:add zerigo_dns:basic command or add Zerio manually through the add-ons page on your Heroku app.
(2) With your registrar or hosting provider to have the domain resolve properly. For Zerigo add all nameservers:
a.ns.zerigo.net
b.ns.zerigo.net
e.ns.zerigo.net
c.ns.zerigo.net
d.ns.zerigo.net
(3) And this is the step I think you may be missing. Log into Zerigo either through your Heroku configuration panel under "add-ons" or log into Zerigo directly. Select the DNS tab next to Account and Servers. On the left panel select the domain you have resolving to Zerigo: this domain will appear. Within this domain under "Nameservers" next to "Hosts" click "Add Snippet". Add both the recommended snippets proxy.heroku.com and the redirect record that excludes the www.
Wait the TTL period (usually 15 minutes) and your domains will work as expected.
Related
To preface this, I am new to backend web development so I'm coming at this totally clueless. My past experience is with Netlify, which makes it pretty seamless to add a custom domain to a website with their free DNS service.
To start, I am working on a Flask application that ideally I would like to put on a subdomain of my website (i.e. app.my-website.whatever, not actually my real domain since it includes my real name) on a different host, in this case Heroku, while keeping my main website (www.my-website.whatever) on Netlify. This required me to switch from using Netlify's DNS to using the DNS tools provided by Google Domains.
After deploying the app on the free domain, which went just fine, I tried setting up my domain for the website, following these steps:
On my website's dashboard, I went to Settings > Domains > Add domain and under domain entered app.my-website.whatever, including the subdomain of course.
Copied the DNS Target Heroku gave me.
At my dashboard for my-website.whatever at domains.google.com, under DNS > Default name servers > Resource records, I added a custom record with the hostname app.my-website.whatever (Google Domains automatically adds the .my-website.whatever), type CNAME, TTL 600, and in the Data field I pasted the DNS Target.
In my Ubuntu (WSL) terminal, when I type host app.my-website.whatever, the output says app.my-website.whatever is an alias for {bunch-of-random-characters}.herokudns.com.
Unfortunately, this has not been successful. When I try to visit the domain, I usually get an error such as DNS_PROBE_FINISHED_NXDOMAIN or alternatively ERR_SSL_UNRECOGNIZED_NAME_ALERT. I've also tried the same thing with just www.my-website.whatever, and the same issues occur.
When I try to visit the site, most browsers will automatically append https://, which I would assume doesn't quite work since I do not have a cert set-up for my site, which I need to do manually.
Does the above error mean that there is a problem related to SSL, or is it something else? Is it because my browser forces https:// that I cannot see anything changing (i.e. would http:// work?)?
From what I can tell, I should be able to do all of this on the free-tire, but I have some confusion about a few details, and feel like I could be missing some other things:
Do I need a certificate/SSL for my custom domain to work at all with Heroku?
If it could possibly be an easier solution: Is there a better alternative to Heroku in my case?
With regards to setting up the cert, I tried following the tutorial here:
https://medium.com/#bantic/free-tls-with-letsencrypt-and-heroku-in-5-minutes-807361cca5d3
For certbot, as the tutorial explains, you are given two strings like so: <long-string>.<other-long-string>, and you need to serve a file at /.well-known/acme-challenge/ with the name <long-string> (no extension), but as an unrelated issue, I cannot get Flask to serve this file, even on a local dev server, and I just get a 404 message, which the certbot utility also reports. I can create another file, such as a simple .txt file, in that same directory, and it will serve just fine.
I'll admit, these issues feel a bit basic, but I genuinely am lost, and none of the guides or posts I see online seem to have any remedy or explanation for what is happening here.
If there is any more information I should share, please let me know.
I have developed an app and make it available via Heroku. Now I would like to add a custom domain name via Ionos however I don't know how to configure it. When using EC2 instances I would configure an static ip address but for Heroku, I don't know what to do. I have checked other post about this but none a precise or recent about what to do.
Thanks for you attention and have a Great day.
Had the exact same issue and here's how I made it work (just specifying I'm not an expert, so take this answer with a grain of salt):
First you'd have to go to Heroku in your app setting and then add the domain name you bought. It's important that you write the host when adding it, like put either www. or *. at the beginning of the domain. It will give you back a DNS target which you will then need to use on Ionos.
Secondly, you'd have to bind this DNS target on Ionos using a CNAME. Just go to your domains, click the one in your list, then open DNS and click Add a record. Choose CNAME and then put www as provider and past the DNS target you copied in target field. Finally, confirm the changes
Wait a few seconds/minutes, navigate to www.yourdomain.whatever and tada!
About static IP address, Heroku made some docs, and that won't work, you'd have to use dynamic ones. So in a nutshell, use CNAMEs instead of A records
Here are some docs if you want to dig more into this
I'm having hard times trying to redirect a custom domain on Heroku, have you guys had the same problem?
Configured custom domain on Heroku (already tried different variation):
The server asks for Server Name, so I add the only thing Heroku returns as the DNS:
Below there are two domains, the first says "servfail" (the current app domain), the second "nxdomain", which I've just bought it's fine.
Any advices? Should I deploy on another server? Thanks for the help!
You need to update the DNS servers of your domain fariba.cl to fariba.cl.herokudns.com at the domain registrar's end (from where you purchased the domain)
After that it will work fine.
For those facing DNS redirecting problems in Heroku, I suggest this Add-on that you can add to your app in Heroku (for free): PointDNS
With it you can get many types of adresses, including IP and/or n1.server n2.server and so on, in which you can add the address to your domain settings.
I'd like when a user types the domain YOURSITE.com to not go into a loop and crash. I've searched for answers for a couple days now and can't seem to find the exact one.
Error from chrome: This webpage has a redirect loop - The webpage at http://YOURSITE.com/ >has resulted in too many redirects. Clearing your cookies for this site or allowing third->party cookies may fix the problem. If not, it is possibly a server configuration issue and >not a problem with your computer.
Background:
Rails 3.2.14 App with Ruby 2.0.0
Domain bought with godaddy
Hosting on Heroku with both domains setup www.YOURSITE.com and YOURSITE.com
Using AWS with route 53 and S3.
Let me know what relevant code you need to help or if this is something that is being caused by AWS or the like. I've tried an reversed several different things via my code, but can't seem to find anything that works.
you should log into your Heroku dashboard, click on the app and then click on the "Production Check" button. This will help you check for DNS issues among other.
Check your DNS Zone file with godaddy. How are you redirecting the sub domain www to the host domain?
On your rails app, how is your route.rb file handling the incoming traffic? do you have any redirection there?
Hope that helps..
There is a very good write up that goes through configuration settings between AWS, the domain registrar (in my case godaddy), and heroku here: https://devcenter.heroku.com/articles/route-53#naked-root-domain I used this originally when I set up my site.
I wish I could say I know what the problem was, but I'm not totally sure what it was. My guess is that it had to do with APEX domains being unsupported by AWS and/or Heroku, and therefore I needed not to try to redirect. Here's the settings that worked for me:
Godaddy domain mysite.com, transferred my DNS stuff to AWS (I had done that prior to the problem)
Heroku: you can either use the CL or you can access the settings for your app online. In either situation I set up my domains to be mysite.com and www.mysite.com
AWS: This is a little trickier. You need to make sure the settings for Route 53 and S3 are exactly like in the tutorial link above. Your mysite.com bucket in S3 must redirect to www.mysite.com.
This isn't ideal and there are probably ways to get around this using different companies for hosting/DNS services, but with the Heroku/AWS combo this is what I had to do to stop the redirect loop.
I'm trying to setup a custom domain for my Heroku Cedar stack app, but it's not working.
I've tried entering 'host www.mydomain.com' command' in Terminal, but it yields no output.
I've already changed my DNS settings and added a 'CNAME' host: www, direct to: my domain.herokuapp.com but still it's not working.
What could I be doing wrong here???
Thanks,
Faisal
The fact that you're not getting any results in terminal for host then the problem lies with your DNS settings - it sometimes takes a while for updates to propogate across the internet, I usually allow for 24 hrs to be sure. If it still doesn't work then you should get in touch with your DNS host.
You also have to add domain entries to your Heroku app:
heroku domains:add yourdomain --app yourapp
The "-app yourapp" is not required if you are in the root directory of your Rails app.
You can repeatedly add more than one domain to your Heroku app.
Here is an article about adding custom domains and DNS setup, at the Heroku Dev Center:
https://devcenter.heroku.com/articles/custom-domains