Heroku domain routing - www works, without fails - heroku

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

Related

DNS_PROBE_FINISHED_NXDOMAIN error on Heroku

I have deployed an app on Heroku, and everything is going great when the app is being accessed from the herokuapp.com domain. I tried adding a custom domain and have followed the instructions from the documentation, but unfortunately, I encounter a DNS_PROBE_FINISHED_NXDOMAIN error when trying to access the app from my custom domain.
Some articles pointed out how Heroku requires the usage of ALIAS ANAME or FLATTENING records, which may not be available in DNS providers. I am using a local DNS provider where Name Server configuration is not directly accessible, and only the DNS provider admin can configure it on my request, so I am unable to check the CNAME Records and such (probably because I use .id domain, which I believe to have a somewhat specific configuration due to its affiliation with the country Indonesia, could be wrong though).
For my Name Server, because my DNS Provider requires at least two different name servers, I registered the domains for my Heroku app (from the Heroku settings dashboard > add domain and from the CLI) as follows:
my-domain.id
*.my-domain.id
www.my-domain.id
Is there anything I can do to fix this? Any help would be highly appreciated! Thank you!
EDIT:
I have just been informed by my DNS provider admin that the name servers I used, which I got from Heroku ([haiku].herokudns.com) does not have IP address. Is there anything I did wrong on the configuration?
As it turns out I managed to find my own mistake! It turns out that I provided the DNS Target as Name Server to my provider, which is totally not the same thing. What solved my problem was simply asking the provider to register a CNAME with the DNS target from Heroku as the value.
Be sure to provide the correct DNS Target for the domains as the DNS Target produced for registering root domains like your-domain.com will be different from the DNS Target produced for registering subdomains like www.your-domain.com or when using wildcard tag (*.your-domain.com). Also, note that Heroku doesn't recommend the usage of A Record for root domains, so be sure that your DNS Provider supports the record types needed as this Heroku article suggests.
Thank you #Ruurtjan Pul for getting in touch! Hope this helps!

Heroku's DNS is causing conflicts with Google Suite MX records

Heroku DNS is causing troubles: cannot recieve any email at myuser#stickersgallito.pe that uses Google Suite as Mailbox.
My host provider is Punto.pe a peruvian company.
My projects is hosted in Heroku, in there I've 2 DNS:
1) www.stickersgallito.pe -> ancient-crab-bwwmzXXXXXXXXXXXX.herokudns.com
2) stickersgallito.pe -> functional-wallaby-XXXXXXXXXXXXXXXX.herokudns.com
I need that people can visit the site entering: www.stickersgallito.pe or just stickersgallito.pe.
So I've entered these 2 records as CNAMEs in my Host Provider Registry Panel.
Problem:
I've also set up other tools like MailGun and Google Suite (to have mailboxes like omar#stickersgallito.pe). MailGun functions correctly, I can visit the page either using: www.stickersgallito.pe or stickersgallito.pe.
But I cannot recieve emails at omar#stickersgallito.pe.
I've consulted my Host Provider and the say that the record for
stickersgallito.pe ->
functional-wallaby-XXXXXXXXXXXXXXXX.herokudns.com is the
problem. It's interfering with other records.
They don't offer any solution, but point to Heroku for a response.
Heroku point me to their documentation and if after following it's steps it doesn't work I should talk to my Host Provider.
My host provider says that if I can provide an IP Address from Heroku we could solve this. Heroku's doesn't offer an IP address as far as I know.
Google Documentation to Set Up MX Records:
https://support.google.com/a/answer/140034?hl=en
What can I do?
DNSs in Host Provider:
Registers:
UPDATE 1:
This is the kind of records my Host Provider allows me to enter: A, CNAME, TXT, MX.
When using heroku domains I get:
The CNAME record is forbidden for the root domain exactly for this reason, it doesn't allow any other records you have to work the way you want them to. In the heroku docs they say to use a CNAME like functionality for the root domain, which is ALIAS or ANAME record, but don't use CNAME, your provider should not even allow you to create it.
You can configure heroku to work for a subdomain (e.g. www) and then use a Web Forwarding/Redirecting for the root domain to the www subdomain, if your DNS host doesn't support ALIAS or ANAME record. Contact them for more information.
Here is more info about the root domain configuration: https://devcenter.heroku.com/articles/custom-domains#add-a-custom-root-domain
And here is for a subdomain: https://devcenter.heroku.com/articles/custom-domains#add-a-custom-domain-with-a-subdomain

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

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.

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.

How do I set up DNS for an apex domain (no www) pointing to a Heroku app?

I already added a custom domain to my Heroku app and it works with www.domain.com.
I need to know how to set up the domain without www to resolve to the app, too.
Here are my current DNS settings:
$TTL 86400
# IN SOA ns1.first-ns.de. postmaster.robot.first-ns.de. (
2013041500 ; serial
14400 ; refresh
1800 ; retry
604800 ; expire
86400 ) ; minimum
# IN NS robotns3.second-ns.com.
# IN NS robotns2.second-ns.de.
# IN NS ns1.first-ns.de.
# IN A 88.198.38.XXX
localhost IN A 127.0.0.1
mail IN A 88.198.38.XXX
ftp IN CNAME www
imap IN CNAME www
loopback IN CNAME localhost
pop IN CNAME www
relay IN CNAME www
smtp IN CNAME www
www IN CNAME appname.herokuapp.com.
# IN MX 10 mail
What are the correct settings to use so that both example.com and www.example.com would point correctly to my Heroku app?
(Note: root, base, apex domains are all the same thing. Using interchangeably for google-foo.)
Traditionally, to point your apex domain you'd use an A record pointing to your server's IP. This solution doesn't scale and isn't viable for a cloud platform like Heroku, where multiple and frequently changing backends are responsible for responding to requests.
For subdomains (like www.example.com) you can use CNAME records pointing to your-app-name.herokuapp.com. From there on, Heroku manages the dynamic A records behind your-app-name.herokuapp.com so that they're always up-to-date. Unfortunately, the DNS specification does not allow CNAME records on the zone apex (the base domain). (For example, MX records would break as the CNAME would be followed to its target first.)
Back to root domains, the simple and generic solution is to not use them at all. As a fallback measure, some DNS providers offer to setup an HTTP redirect for you. In that case, set it up so that example.com is an HTTP redirect to www.example.com.
Some DNS providers have come forward with custom solutions that allow CNAME-like behavior on the zone apex. To my knowledge, we have DNSimple's ALIAS record and DNS Made Easy's ANAME record; both behave similarly.
Using those, you could setup your records as (using zonefile notation, even tho you'll probably do this on their web user interface):
# IN ALIAS your-app-name.herokuapp.com.
www IN CNAME your-app-name.herokuapp.com.
Remember # here is a shorthand for the root domain (example.com). Also mind you that the trailing dots are important, both in zonefiles, and some web user interfaces.
See also:
Doing DNS right with Heroku
Avoiding Naked Domains and DNS A-records
Remarks:
Amazon's Route 53 also has an ALIAS record type, but it's somewhat limited, in that it only works to point within AWS. At the moment I would not recommend using this for a Heroku setup.
Some people confuse DNS providers with domain name registrars, as there's a bit of overlap with companies offering both. Mind you that to switch your DNS over to one of the aforementioned providers, you only need to update your nameserver records with your current domain registrar. You do not need to transfer your domain registration.
To point your apex/root/naked domain at a Heroku-hosted application, you'll need to use a DNS provider who supports CNAME-like records (often referred to as ALIAS or ANAME records). Currently Heroku recommends:
ALIAS at DNSimple
ANAME at DNS Made Easy
ANAME at easyDNS
ALIAS at PointDNS
CNAME at CloudFlare
Whichever of those you choose, your record will look like the following:
Record: ALIAS or ANAME
Name: empty or #
Target: example.com.herokudns.com.
That's all you need.
However, it's not good for SEO to have both the www version and non-www version resolve. One should point to the other as the canonical URL. How you decide to do that depends on if you're using HTTPS or not. And if you're not, you probably should be as Heroku now handles SSL certificates for you automatically and for free for all applications running on paid dynos.
If you're not using HTTPS, you can just set up a 301 Redirect record with most DNS providers pointing name www to http://example.com.
If you are using HTTPS, you'll most likely need to handle the redirection at the application level. If you want to know why, check out these short and long explanations but basically since your DNS provider or other URL forwarding service doesn't have, and shouldn't have, your SSL certificate and private key, they can't respond to HTTPS requests for your domain.
To handle the redirects at the application level, you'll need to:
Add both your apex and www host names to the Heroku application (heroku domains:add example.com and heroku domains:add www.example.com)
Set up your SSL certificates
Point your apex domain record at Heroku using an ALIAS or ANAME record as described above
Add a CNAME record with name www pointing to www.example.com.herokudns.com.
And then in your application, 301 redirect any www requests to the non-www URL (here's an example of how to do it in Django)
Also in your application, you should probably redirect any HTTP requests to HTTPS (for example, in Django set SECURE_SSL_REDIRECT to True)
Check out this post from DNSimple for more.
I am now using Google Apps (for Email) and Heroku as web server. I am using Google Apps 301 Permanent Redirect feature to redirect the naked domain to WWW.your_domain.com
You can find the step-by-step instructions here
https://stackoverflow.com/a/20115583/1440255
You are not allowed to have a CNAME record for the domain, as the CNAME is an aliasing feature that covers all data types (regardless of whether the client looks for MX, NS or SOA records). CNAMEs also always refer to a new name, not an ip-address, so there are actually two errors in the single line
# IN CNAME 88.198.38.XXX
Changing that CNAME to an A record should make it work, provided the ip-address you use is the correct one for your Heroku app.
The only correct way in DNS to make a simple domain.com name work in the browser, is to point the domain to an IP-adress with an A record.

Resources