Why MX records?

I previously asked about the MX record (and appreciated the thoughtful answers I received from SO'ers). Now that this problem has been resolved, I want to step back and ask why there are MX records in the first place.

In particular: why does SMTP receive special DNS treatment?

We do not have HX records for HTTP or FX records for FTP. It seems that every other Internet protocol goes well with a DNS record. Indeed, the Wikipedia article on MX records claims that the current SMTP specification says that if the MX record does not exist for the recipient, the server should go back to record A. It also mentions some SMTP hosting done in the world before DNS, but it was 25 years old back. Do we really need MX records?

+15
smtp dns mx-record
Dec 21 '08 at 23:34
source share
5 answers

MX records were used because SMTP traffic for user@domain had to route different traffic for this domain differently, and SRV had not yet been invented.

The modern convention that you can enter http://example.com/ in your browser without the www prefix and still get to the website you want is actually a bit strange. To explain in more detail how to configure a zone to achieve this prefix 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 

Thus, any traffic addressed to example.com is redirected to this IP address, regardless of the protocol used (unless it is sent by email, which will use the MX record).

In practice, it would be preferable if all applications used SRV , and then we could bypass all application prefixes and also use A records for their real purpose - in particular, mapping real host names to IP addresses.

If the SRV records were used in such a way that the zone file would look like this:

 $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 

This assumption that the primary A record in the domain is actually used for the HTTP service is also part of the reason that the Verisign SiteFinder "" caused as many problems as it did (in short) introduced in 2003. Having intercepted all the DNS A records for unknown domains and returned one of its own addresses, Verisign violated all sorts of protocols that suggested that they could fail -over to other address database mechanisms if the DNS lookup failed.

+32
Dec 22 '08 at 0:57
source share

The main purpose of MX records is the ability to specify machines for processing a specific protocol for the entire domain, as well as specify backup mail servers (with different priorities). Thus, if one server fails, it can reach the next server in the queue to deliver e-mail to this domain. None of these can be done using simple A entries that display the direct full name using the host.

Now you can do it with SRV records (dated 8 years ago, not 25), as Frank notes. Then there were many other standard protocols available in droves.

+5
Dec 21 '08 at 23:39
source share

It seems that all other Internet protocols go well with the DNS "A" record.

Well, the SRV record type is available to them.

Perhaps if SMTP wrote today, he would use that.

+2
Dec 21 '08 at 23:37
source share

In addition to allowing the specification of backup exchangers, note that not every domain has its own mail server, so you must be able to specify a mail server that exists in another domain authorized to exchange email, so that administrative and system messages addressed to postmaster, root or any technical / administrative contacts listed in the WHOIS DNS records can be delivered even if they do not exist in the current domain.

You simply do not need this for ftp and http, because these services do not initiate outgoing connections, such as MX, and are not considered official contact persons.

+2
Dec 22 '08 at 0:05
source share

Never neglect explanations of "historical reasons." Back in the early 80s, SMTP was pretty much the only public protocol that was supposed to be available to display the entire site - and DNS was searched using a common HOSTS file on many systems.

+2
Dec 22 '08 at 0:21
source share



All Articles