Heroku + Gmail + CNAME + 1&1 = woes - heroku

Heroku recently said they are moving everyone off the legacy dns they had before and wanting everyone to use CNAMEs. That's great, except that my client also uses Google Apps for their email. Turns out that with 1&1 you cannot point a domain to a CNAME and give it a custom MX record for email, which is what you need to route to Google...
Anyone else come across this? Any ideas on how to fix this so that I can use the domain, specify a CNAME and specify a MX? Is this just a limitation that 1&1 imposes, or is this "the way things work" with CNAME records?
Thanks

I'm not familiar with "1&1", but there's absolutely no reason why you should be limited to have two records: one CNAME pointing www.example.com to your Heroku app, and one MX pointing example.com to your Google mail servers.
If your DNS provider truly doesn't allow this, there's no reason to stay with them.

Related

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.

How to use a domain name from name.com for a Heroku app?

I have an application running on example.herokuapp.com. No subdomains, no HTTPS, just a basic, read-only application. I also bought my domain name example.com from name.com. How do I link my domain name to the Heroku app?
I found these two questions, but I can't understand them, don't have any idea what DNS, CNAME, A records etc. are..
How to configure DNS records for Name.com and a Heroku app
How to connect my domain bought on name.com with my herokuapp?
I would appreciate a dummy-friendly explanation on how to setup my domain name with my Heroku app.
From this page I understand (guess) I need to use an additional service such as DNSimple or CloudFlare, is this correct? I tried CloudFlare but there is an additional problem that my domain is already linked to 000webhost.com (which I want to remove) via name.com. Anyways, please just tell me what do I need to have in the end :) Also I prefer to use only the free plans, if possible.
Thanks in advance

DNS Problems with Heroku

I'm having some problems configuring the DNS settings for my custom domain to work correctly on Heroku.
I have set the DNS records as follows:
Host Type Points to
example.com WR www.example.com
www.example.com CNAME example.herokuapp.com
www.example.com.au CNAME example.herokuapp.com
However, the 'www.example.com' domain sometimes fails to load on my computer, as well as my client's phone. It seems rare for this domain to fail (it works fine on everyone else's computers that I've asked), but the fact that it doesn't work on mine and my client's computers is a problem.
However, the '.com.au' domain (and the heroku one) always works. Why is this?
Is there anything wrong with the configuration above? I followed the 'custom domain names' article on heroku to reach this configuration (I don't have much experience with DNS, unfortunately). The DNS provider I am using does not support ANAME or ALIAS so I went with the above config instead.
Thanks. Any help in getting the '.com' domain working on every device would be appreciated.
I'm not really sure, it may be a lot of things, DNS caching and other stuff.
But if you don't have a lot of DNS records, I suggest you use a heroku add-on like PointDNS (https://addons.heroku.com/pointdns) as it supports ALIAS.

Setting up Cloudflare CNAME to work with Microsoft Exchange

We have a hosted website that uses Cloudflare to improve website speed performance and load times. As such, the DNS details for the site currently include:
-MX records leading to the hosting provider for emails.
-CNAME record for the hostname to be routed via Cloudflare for website performance
We recently decided that we wished to move our email mailboxes from the hosting provider to Microsoft Exchange. However, Microsoft has advised that as part of the migration process, we need to create a CNAME record in CloudFlare to allow for autoconfiguration of Microsoft Outlook to pickup mailbox settings associated with the hostname. However, CloudFlare only allows for 1 CNAME to exist which is currently used to route website traffic via CloudFlare.
Question: I don't want to get rid of CloudFlare services by changing the CNAME record to point to Microsoft's outlook configuration address for Exchange. Is there anyway that I can create an additional CNAME record? I came across CNAME flattening but i'm not sure if it would be applicable in this scenario or what the steps would be to implement it. This surely can't be the first time someone has wanted to have their website traffic routed via Cloudflare but their hostname also to be used for Microsoft Exchange email.
I'm hoping there is some creating way around it, even if it's creating a subdomain (e.g. traffic.domain.com) which one CNAME can route web traffic to CloudFlare to while another subdomain (mail.domain.com) has a CNAME to route to Microsoft's outlook autoconfig.
Any help or advice would be appreciated.
Please open a support ticket and we can assist. If we are managing your DNS fully, there is no limitation to the number of CNAMES in settings. You should still be able to put a CNAME in your DNS settings pointing to Microsoft.

Heroku & DNS: Can http://nakeddomain.com aim at my heroku app?

So, I've been reading quite some content about this. The latest one being here, and the heroku doc.
At the end, nobody answers the question clearly:
Is it possible to have http://nakeddomain.com aiming at a heroku app?
Here's what I know:
It is easy to redirect http://nakeddomain.com to http://www.nakeddomain.com to CNAME http://myapp.herokuapp.com : I don't want to do that
It is sometimes possible to ANAME (or ALIAS, or CNAME depending on the DNS provider vocabulary) apex name to another record. But in that case, all records are CNAMEd or ANAMEd (even the MX for mail delivery) which makes mail#nakeddomain.com unroutable as redirected to heroku app which certainly doesn't handle it by default.
So I'm going to reformulate
Is it possible to have http://nakeddomain.com aiming at a heroku app while using mails#nakeddomain.com?
How? Which services to use?
How much does it costs if there are extras to pay?
Should I stick on CNAMing apex name and move the mailer to another service (Google Apps, or Sendgrid as some suggest in Stackoverflow) or is it making it worse?
Subsidary questions:
Been reading Cloudflare is quite nice. How does it help me?
We are using 1and1 as a DNS provider currently? Does it make it easier/harder anyhow?
Been also reading DNSimple allows more features than other DNS providers. Which one?
Since we send automatic mails from our app, SPAM filtering is also a concern from mails#nakeddomain.com, if that has to do with the required configuration.
Thanks for support
Apex domains have no impact on using the naked domain for emails - completely different types of record. I have domains using DNSimple CNAMEs and the same domain for email. One is a cname, the other is an MX reocrd.
I would suggest using DNSimple or the cheaper option DNS made easy - both support ALIAS records, with the $30 a year plan you get 10 domains. I typically using one or the other and Google Apps for email which works just fine. For applications to send email I use Sendgrid.
CloudFlare is a caching layer. To use them you have to move your DNS to them.
You can use 1&1 as your registrar but you then use one of the previously mentioned to host the DNS - they have far superior services. Both provide CNAME but also redirection at DNS level so you can have www.domain.com redirected to domain.com at DNS level and not in your application. If you use Sendgrid for sending emails I'm sure they have a SPF record you can put on your domain to help keep emails out of spam folders.
EDIT:
Cloudflare seems to be the good solution for me: brings CDN and naked domain through changing DNS servers to their own and they have a free plan.
I'm going to answer point by point to explain what I've done:
Is it possible to have http://nakeddomain.com aiming at a heroku app while using mails#nakeddomain.com?
Yes
How? Which services to use?
Only using DNSimple or DNS made easy, as they handle ALIAS/ANAME records.
How much does it costs if there are extras to pay?
Cheapest is DNS made easy with $30/year
Should I stick on CNAMing apex name and move the mailer to another service (Google Apps, or Sendgrid as some suggest in Stackoverflow) or is it making it worse?
Haven't explored this option much, but if your domain provider has decent mail services, no reason to move out of it. It probably costs more money for this service...
Subsidary questions:
Been reading Cloudflare is quite nice. How does it help me?
Finally did not end up using it...
We are using 1and1 as a DNS provider currently? Does it make it easier/harder anyhow?
1and1 doesn't have ALIAS/ANAME records. So I had to use extra service (DNS made easy in my case), they give you a list of dns hosts that need to be replaced in the 1and1 interface and then it takes care of the rest.
Careful: For beginners reading this, updating these entries won't assign changes all over the web at once as DNS is based a lot on caching. You need to take this in account when doing changes, if you have production services. You could end up with weird behaviors between like infinite redirects, cdn not properly redirecting, or OAuth redirects broken for a while ...
Been also reading DNSimple allows more features than other DNS providers. Which one?
More customization is possible with DNS made easy. Interface will be more user-friendly also.
Eg. 301 redirects instead of 302 for 1and1, PTR records and other newest DNS records
Since we send automatic mails from our app, SPAM filtering is also a concern from mails#nakeddomain.com, if that has to do with the required configuration.
I read PTR records were good to prevent SPAM, but as far as I understood, it doesn't make sense when using heroku because the whole point of this record is to aim IP-Address to nakeddomain.com which is not possible as heroku doesn't provide fixed IP-addresses.
Hope it helps.

Resources