MX Must Point to Host with an A or AAAA Record

The A and AAAA records for a host are lines that give the host’s IP address or addresses:

hostC  IN     A      123.45.67.8                 ← IPv4
hostC  IN     AAAA   3ffe:8050:201:1860:42::1    ← IPv6

Here, hostC is the host’s name. The IN says this is an Internet-type record. The A marks this as an IPv4 A record, with the IP address 123.45.67.8. The AAAA marks this as an IPv6 AAAA record, with the IP address 3ffe:8050:201:1860:42::1.

An MX record must point to a hostname that has an A or AAAA record. To illustrate, consider the following:

hostA  IN     MX  10 hostB           ← illegal
       IN     MX  20 hostC
hostB  IN     MX  10 hostC
hostC  IN     A   123.45.67.8

Note that hostB lacks an A record but hostC has one. It is illegal to point an MX record at a host that lacks an A or AAAA record. Therefore, the first line in the preceding example is illegal, whereas the second line is legal.

Although such a mistake is difficult to make when maintaining your own domain tables, it can easily happen if you rely on a name server in someone else’s domain, as shown here:

hostA    IN     MX  10 mail.other.domain.

The other administrator might, for example, retire the machine mail and replace its A record with an MX record that points to a different machine. Unless you are notified of the change, your MX record will suddenly become illegal.

Note that although an MX record must point to a hostname that has an A or AAAA record, it is illegal for an MX record to point directly to an A or AAAA record:

hostA  IN     MX  10 123.45.67.89           ← illegal ...

Get sendmail, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.