gpt4 book ai didi

email - Azure 应用程序的 CNAME 导调用子邮件出现问题,MX 和 A 记录被忽略

转载 作者:行者123 更新时间:2023-12-04 11:54:32 28 4
gpt4 key购买 nike

我们有一个在 Microsoft Azure 上运行的应用程序,并设置了 CNAME 记录来覆盖该域,因此我们可以获得漂亮的 URL http://example.com (请注意,我在整个过程中将我们的真实域名替换为 example.com)。

CNAME
mydomain.com -> mydomainapp.cloudapp.net

我们已正确设置 MX 和 A 记录,因此 MX 包含 mailserver.example.com 和将邮件服务器指向正确 IP 地址的 A 记录。

MX
mailserver.example.com

A
mailserver -> 198.168.111.111 (note this IP is fictitious)

一切都很好,对于大多数电子邮件,但对于某些邮件服务器(尚不确定是什么技术),他们现在使用 CNAME 而不是 MX 和 A 记录。

因此,一封电子邮件发送至 [email protected]实际上发送到[email protected]其中 example.cloudapp.net 是我们使用 CNAME 映射的 Azure 上的域。

EMAIL TO: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="412b24333338012439202c312d246f222e2c" rel="noreferrer noopener nofollow">[email protected]</a>
BECOMES: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aac0cfd8d8d3eacfd2cbc7dac6cfcbdada84c9c6c5dfcecbdada84c4cfde" rel="noreferrer noopener nofollow">[email protected]</a>

我能找到的唯一建议只是说不要有域级 CNAME 或根本不使用 CNAME,但是当然 Azure IP 地址可以更改,因此我们必须使用 CNAME。我们可以为所有内容添加前缀 www.example.com,但肯定有更好的解决方案。

非常感谢任何想法。

最佳答案

无法在域级别使用 CNAME 记录,因为 CNAME 是所有 RR 类型的别名,因此它始终会导致 MX、SOA、NS 等查找的重定向也是如此。

以下摘录自 RFC1912 第 2.4 节,说得非常清楚:

A CNAME record is not allowed to coexist with any other data. In
other words, if suzy.podunk.xx is an alias for sue.podunk.xx, you
can't also have an MX record for suzy.podunk.edu, or an A record, or
even a TXT record. Especially do not try to combine CNAMEs and NS
records like this!:

       podunk.xx.      IN      NS      ns1
IN NS ns2
IN CNAME mary
mary IN A 1.2.3.4

This is often attempted by inexperienced administrators as an obvious way to allow your domain name to also be a host. However, DNS servers like BIND will see the CNAME and refuse to add any other resources for that name. Since no other records are allowed to coexist with a CNAME, the NS entries are ignored. Therefore all the hosts in the podunk.xx domain are ignored as well!

因此,您不得mydomain.com 使用 CNAME 记录!

因此,您必须为 mydomain.com 设置 A 记录(根据需要在 MX:s 和其他记录中),因为这是唯一有效的 DNS 解决方案。

关于email - Azure 应用程序的 CNAME 导调用子邮件出现问题,MX 和 A 记录被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15886288/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com