5

I have a domain, example.com, for my mom's business. I'm having trouble configuring the records to allow the Heroku app to exist simultaneously with email through Microsoft Office 365. The site should be accessible by www.example.com and https://example.com. It is currently only working with the www version.

The issue is that I need a CNAME record pointing to example.com, but can't use host = @ because it will break the MX records due to the priority of CNAME.

Here's my current configuration:

TYPE  | host | value                                       | TTL
----------------------------------------------------------------
CNAME | www  | www.example.com.herokudns.com.           | 60
MX    | @    | example-com.mail.protection.outlook.com. | 60

This works. But the site isn't accessible at example.com (without the www). I would like to make it:

TYPE  | host | value                                       | TTL
----------------------------------------------------------------
CNAME | @    | example.com.herokudns.com.               | 60
CNAME | www  | www.example.com.herokudns.com.           | 60
MX    | @    | example-com.mail.protection.outlook.com. | 60

But then her email stops working. How can I make the site accessible at example.com?

  • Which DNS provider are you using? – jrtapsell Jun 17 '18 at 19:18
  • @jrtapsell NameCheap. – Chris Cirefice Jun 17 '18 at 19:29
  • You can not have a CNAME at apex since this record type can not cohabit with any others (to summarize quickly) and at apex you obviously already have SOA and NS records. Various providers hide this fact by giving you virtual records, not part of the DNS, called for example ANAME or ALIAS. – Patrick Mevzek Jun 19 '18 at 18:51
4

Putting a CNAME record at the root of your domain breaks email. If you want email to work, you just can't do that.

Heroku has instructions for this case. You need to use a DNS host that supports "alias" records. They are also sometimes called "aname" or "proxy" records. Those are served as normal A records with an IP address, but the server periodically looks up that IP address from a host name.

NameCheap has Tweeted that they don't support ANAME records, so you will have to move to a new DNS host that has such a feature. The Heroku instructions list several that do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.