问题原文
原帖链接 · Chris Cirefice · CC BY-SA 4.0
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?
已采纳解答
原帖链接 · Stephen Ostermiller · CC BY-SA 4.0
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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
