为什么有MX记录? [英] Why have MX records?

查看:191
本文介绍了为什么有MX记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前问了一个问题关于MX记录(并感谢我从SO'ers收到的深思熟虑的答案)。现在这个问题解决了,我想退一步,问为什么首先有MX记录。

I previously asked a question regarding MX records (and appreciate the thoughtful answers I received from SO'ers). Now that that problem is resolved, I want to step back and ask why there are MX records in the first place.

具体来说:为什么SMTP得到DNS的特殊处理?

Specifically: Why does SMTP get special treatment by DNS?

我们没有用于FTP的HTTP或FX记录的HX记录。似乎每一个其他的互联网协议都与DNS的A记录一致。实际上,关于MX记录的维基百科文章指出,目前的SMTP规范说如果MX记录对于接收器不存在,服务器应该回到A记录上。它还提到了一些在DNS前的世界中制造的SMTP,而这是25年前。我们真的需要MX记录吗?

We don't have HX records for HTTP or FX records for FTP. It seems like every other Internet protocol gets along just fine with DNS' A record. Indeed, the Wikipedia article on MX records states that the current SMTP spec says that if an MX record does not exist for a receiver, the server should fall back on an A record. It also mentions some accommodations SMTP made in a pre-DNS world, but that was 25 years ago. Do we really need MX records any more?

推荐答案

MX 因为需要SMTP流量到 user @ domain 被不同地转发到该域的其他流量,而 SRV 记录尚未发明。

MX records were used because there was a need for SMTP traffic to user@domain to be routed differently to other traffic for that domain, and SRV records hadn't been invented yet.

您可以键入 http://example.com/ 在您的浏览器中没有 www 前缀,仍然得到所需的网站实际上有点奇怪。要更详细地解释,考虑一个区域通常如何设置来实现这个无前缀的访问:

The modern convention that you can type http://example.com/ in your browser without a www prefix and still get to the required website is actually a bit odd. To explain in more detail, consider how a zone would normally be setup to achieve this prefix-less access:

$ORIGIN example.com
@        IN A   192.168.1.1
         IN MX mail.example.com
www      IN A  192.168.1.1
mail     IN A  192.168.1.2

所以,任何流向 example.com 的流量都会转到该IP地址的使用协议(除非是使用MX记录的电子邮件)。

So, any traffic addressed to example.com goes to that IP address, regardless of the protocol in use (unless it's e-mail which will use the MX record).

在实践中,最好是所有应用程序使用 SRV 记录,然后我们可以将所有应用程序特定的前缀全部删除,并将A记录用于实际目的 - 具体映射实际的主机名

In practise it would be preferable for all applications to make use of SRV records, and then we could do away with the application specific prefixes all together, and use A records for their real purpose - specifically mapping real hostnames to IP addresses.

如果使用SRV记录,则该区域文件将如下所示:

If SRV records were used in this way that zone file would look instead like:

$ORIGIN example.com
_http._tcp IN SRV 0 0 80 www.example.com
_smtp._tcp IN SRV 0 0 25 mail.example.com
www        IN A 192.168.1.1
mail       IN A 192.168.1.2

这个假设,一个域的主要 A 记录实际上是HTTP服务也是Verisign的 SiteFinder 服务引起了与2003年(简要)介绍的许多问题相同的问题。通过拦截所有DNS A 记录查找未知域并返回自己的一个地址,Verisign打破了各种协议,假设如果DNS查找失败,可以将其故障切换到其他地址数据库机制。

This assumption that the primary A record at a domain is actually for HTTP service is also part of the reason why Verisign's SiteFinder "service" caused as many problems as it did when it was (briefly) introduced in 2003. By intercepting all DNS A record lookups for unknown domains and returning one of their own addresses, Verisign broke all sorts of protocols that assumed that they could fail-over to other address database mechanisms if the DNS lookup failed.

这篇关于为什么有MX记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆