Connect an Heroku app to a Ionos domain Name - heroku

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

Related

Unable to set up custom domain on Heroku using Google Domains DNS?

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.

How to use Azure Web App + Azure DNS for root domain?

I'm trying to do something pretty simple. I have a domain on godaddy. I want to use Azure Dns to host the domain and connect it to an azure website.
I have it working for www.mydomain.com with the CNAME approach. However I cannot get the root domain, i.e. my domain.com to work with this approach. I tried adding an * A record but that didn't work. I also tried to do CNAME with # but that didn't work either.
Does anyone know how to get the root domain to work? This seems pretty basic but there is no documentation and it is not obvious.
Thanks
Thanks for feedback on this one!
If you need to create the isolated deployment with the static IP, take a look at the Service Environment. The reference first and second.
As you mentioned Azure DNS, i assume that you refer to the Azure DNS service. If so, then it is possible if you have the needed access. Reference for the DNS zones.
Regarding your question about www and CNAME, there are some nuances that should be taken into account and set up. Please refer to that post.
You can set up a DNS 'A' record in Azure DNS to point to the IP address listed for the site in the Web Apps portal (as per the screenshot provided by an earlier answer). The Web Apps team provide the IP address for precisely this purpose, and they know that they can't change these IP addresses because DNS entries would break.
Note that there's no need to use a wildcard record (name = '*'). You should instead use an A record at the domain apex (name = '#', or if using the Azure Portal you can also leave the name blank).
If your hosted your WebAPP in free website plan didn't have any option for adding * A record. You have to Change your web App plan to at least Shared Plan instead of free Plan.

pointing Hostgator domain to Zerigo/DNsimple ALIAS

After reading about how a my-app.herokuapp.com cannot be referenced by an A Record by the simple fact that Heroku has a dynamic implementation of its servers, I chanced upon articles which extolled the uses of ALIAS functions in DNS services like Zerigo and DNsimple as a workaround for this issue.
This SO Post explains this problem has been solved, Point top level domain to heroku app
However I do not follow how exactly to implement the solution.
Assuming I have a functional ALIAS setup in Zerigo which points to my my-app.herokuapp.com how do I then have my current webhost point to this ALIAS for the root domain?
Here is my Hostgator Control Panel which shows how the root domain (fls.net) is directed to a particular server via an A Record. I would like to subistute that A Record with my Zerigo ALIAS. How do I do that? Do I change my A Record to a CName? and then just put the ALIAS name in?
Note:
This post: How to redirect a root (naked) domain to www - heroku and zerigo seemed to have the same issue, except I don't understand why he calls the solution of using an ALIAS as "temporary". Why would it be a temporary solution?
You have to change your domain's name servers to point to Zerigo's name servers. You do this through your HostGator config. Zerigo has an article on the name servers that your domain should use. This article from HostGator explains how to change your domain's name servers. Basically, you want to log in to the HostGator portal and change the name server's to the one's listed in Zerigo's article.
Zerigo can handle the DNS for your domains, but only if DNS resolvers know to look at Zerigo instead of HostGator. Right now, when a DNS resolver (such as the one used by your computer's operating system) looks up the IP address to which yourdomain.com resolves, it first looks for the name servers that handle yourdomain.com, and then queries them. If the name servers point to HostGator, it doesn't matter what records you put in Zerigo, because HostGator will be queried for the domain's associated IP address. If you want Zerigo to handle the DNS resolution, you have to point the name servers to those managed by Zerigo instead.

How do i allow my users to use custom domains on AppHarbor?

Free users will get a url like user1.myapp.com
The paid ones will be able to point their domains to my app. And my app will serve specific content based on the domain name.
Is this possible with AppHarbor? Is yes how?
Yes, it is possible to use custom hostnames on AppHarbor.
If you go to the list of your applications on AppHarbor and click the application, you can click "Hostnames" in the navigation shown left. When you add a hostname there will be instructions on how you need to configure the DNS.
The DNS can be configured in two ways:
You can use an A record which will point the domain to the IP address. This is required for root domains (example.com).
You can use a CNAME record which will reference the existing A record AppHarbor maintains, which is better in most cases as you'll not need to maintain DNS yourself.
There is currently no way to add hostnames via the API, although you can easily wrap something up that will issue HTTP requests similar to those of the website.

DNS How do I setup Multiple A records pointing to the same sub-domain?

I have a sub-domain sub1.primary.com that works correctly. Now I need to setup sub2.primary.com and have it point to the same web application as sub1.primary.com. I tried it as a new A record and a new CName however when I try navigating to sub2.primary.com and expect to see sub1.primary.com I see a completely different application that sits on sub7.primary.com.
I have tried the A record solo, the CName solo, both together, and each instance with and without pointer records. I am using a Windows 2003 Server with IIS 6. I tried googling for an answer and couldn't find any information.
Here is my setup at the moment. I have created a Host (A) record in DNS for sub2.primary.com with an associated pointer record. I have added the sub2.primary.com to host headers of sub1.primary.com. Whenever I navigate to sub2.primary.com it displays sub7.primary.com instead of sub1.primary.com. Which is bizarre because if it were going to default to something I would rather it default to www.primary. com.
I don't know if it matters but the sub1.primary.com is under SSL and so is sub7.primary.com, along with 5 others on a *.primary.com SSL cert.
Each subdomain should have an A record pointing to the same IP. I sounds like this is what you tried first -- if that didn't work, I'd suggest making sure that your web server's vhost configuration is sending sub2.primary.com to the right place.
When IIS hosts multiple websites on the same IP address, it uses the incoming request URLs to guess which virtual site to send the client to.
In other words: you need to configure your host headers to accept both names for the appropriate web site. Microsoft publishes some good how-to documentation here and here, or here is a more detailed explanation.

Resources