Adding a CNAME record in Cloudflare pointing to a Heroku hosted application - heroku

I have a NodeJS application hosted on Heroku and I'm using Cloudflare to handle my DNS settings.
Unfortunately, the root domain for my application won't resolve since I don't have CNAME record pointing to it and correspondingly, I also receive the following error on my Cloudflare dashboard:
"An A, AAAA or CNAME record was not found pointing to the root domain. The XXXX.com domain will not resolve".
I found the relevant documentation for Heroku-hosted apps (shown below) which explains that all I need to do is to add a CNAME record for my root and point it to the server name. (It also states why I can't point it to a static IP address)
My problem is - how do I add a CNAME record pointing to the server name when the field I'm supposed to add the server name to only accepts an IP address?
See below screenshots.
Additionally, I'm further confused by the following piece of documentation:

Turns out this is a browser issue with Cloudflare.
On Firefox this is what the CNAME input fields look like.
On Chrome this is what the CNAME input fields look like.

Related

Heroku domain routing - www works, without fails

I have been attempting to point my custom domain to the Heroku DNS target. I believe I have followed the steps as listed by the herokudev website. I have been able to point my domain www.databunked.com to my app. However, if I just type databunked.com, I am forwarded to www.databunked.herokuapp.com.
A run of heroku domains gives the following output:
Domain Name DNS Record Type DNS Target
databunked.com ALIAS or ANAME left out for security
www.databunked.com CNAME left out for security
I am using Godaddy.
In the Forwarding block in the DNS Manager:
In the Records Block:
I will be on standby to provide extra information if necessary! I appreciate any help or suggestions on how I could improve this post so you could better help me.
Forward your root/naked domain url of Heroku hosted application using the below rule.
Record: ALIAS or ANAME
Name: empty or # (Depending on the DNS provider)
Target: databunked.herokuapp.com.
Read more here - https://devcenter.heroku.com/articles/custom-domains#configuring-dns-for-root-domains

How to have two records for example.com both for MX and as CNAME for www.example.com

I have a CNAME record for www.example.com with value of www.example.com.herokudns.com, and also for example.com with the value of example.com.herokudns.com.
The problem is that I do not know how to make MX records for a mail server on my domain provider server without losing the above functionality.
If I try to create MX records, the domain provider server complains that CNAME exists for example.com and I must remove it. If I remove it and create records for MX as instructed by mail server provider, the mail starts working but browsing to example.com is not possible. Only www.example.com continues to work.
How I could solve this? I tried to google and read about CNAME similar questions here, but can't find any solution.
This is a direct incompatibility with DNS based PaaS like Heroku which doesn't have a single static IP endpoint, and the nature of DNS. You do have options, but you need to assess how each one compliments or counters the very reason you chose an integrated platform like Heroku in the first place. Fortunately, there does look like there's some simple and effective solutions, depending on your exact configuration and providers:
The long and short of it is:
It's not standard to CNAME the apex '#'
See here, here, and here for more details.
Heroku explain that you need to use a DNS provider that supports CNAME functionality at the apex, or use sub-domains exclusively
See https://devcenter.heroku.com/articles/custom-domains#add-a-custom-root-domain
There's a good write-up on this specific topic here:
Heroku and Root (aka “apex” or “naked”) Domains
At face value, the PointDNS addon looks dead simple:
heroku domains:add example-domain.com
NOTE: I've never tried PointDNS and have no opinion of them at all. The suggestion is merely a copy/paste from a heroku article based on simplicity.

Pointing the root domain to Heroku

I have an app on Heroku, but I can't get the naked root domain to work.
I have a CNAME record for www.mydomain.com pointing to my app.herokuapp.com
I can't create a CNAME for mydomain.com, domain provider tells me I need to do it through an A record, that points to my IP address.
So, since Heroku won't give me that IP address, how can I proceed?
Thanks
DNS RFC (RFC1033) requires the "zone apex" (sometimes called the "root domain" or "naked domain") to be an "A Record," not a CNAME.
CloudFlare provides a feature called CNAME Flattening which essentially solves this problem for you.
Read more: https://blog.cloudflare.com/zone-apex-naked-domain-root-domain-cname-supp/

Custom domain for heroku app

I am having troubles with setting up custom domain for my heroku app.
here is my heroku app:
https://evening-beyond-1234.herokuapp.com/
and let's say it is my domain:
my-fake-domain.com
So I want my app being able at this domain.
I've added this domain to heroku app domains:
$ heroku domains
=== evening-beyond-1234 Heroku Domain
evening-beyond-1234.herokuapp.com
=== evening-beyond-1234 Custom Domains
Domain Name DNS Target
---------------- ---------------------------------
my-fake-domain.com evening-beyond-1234.herokuapp.com
And on the site where I've bought the domain I can change DNS, so I did this:
1) Type of DNS -> DNS from other hosting provider
2) 1st DNS server (*required) -> evening-beyond-1234.herokuapp.com
3) 2nd DNS server (*required) -> evening-beyond-1234.herokuapp.com
I put the same for the second DNS, because it is marked as required, so I need to specify two DNS.
It's been a few days after these changes and it does not work.
There is also another option for changing DNS: extended DNS editor.
I can specify CNAME entries and others there.
Any ideas what I am doing wrong?
I am completely new to this area, it should be just a silly mistake from my side %)
Your configuration is incorrect. What you are doing is that you are changing the name server of your domain, hence moving the delegation to Heroku.
However, Heroku is not an authoritative name server, hence you can't delegate your domain to them.
What you need to do is restore the delegation at your hosting provider and, instead, check the documentation of your hosting/DNS provider to learn how to create an A or CNAME record to point your domain to Heroku.
Also note that you will not be able to point your apex domain (hence my-fake-domain.com to Heroku unless you use one of these DNS providers that support a CNAME-like capability for the apex domain.
Regardless who you use, you can create a CNAME record to point www.my-fake-domain.com to evening-beyond-1234.herokuapp.com.
For my-fake-domain.com you either create an ALIAS/ANAME according to one of those provider documentation, or you redirect the domain to the www version.

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.

Resources