MX DNS Records

MX DNS records are "mail transfer" records, meaning that email destined for a certain domain will use MX records to find servers which will accept email for that domain.

MX records are similar to CNAME records in that they do not refer to IP addresses, but another host name. However, they are different in that they must refer to an A record (which in turn points directly to an IP address). They do not have to point to a hostname within the same domain. For example, example.com can have an MX record of 2.mx.myexample.net.

Most domains have more than one MX record, each with a priority that mail relays are supposed to select in order - the higher the priority value, the lower the priority.

MX records don't necessarily have to point to the final destination of an email, only to an email server which will accept mail for a specific domain - either deliver it to the final destination or pass it on to a relay which will do so. Herein lies the concept of a backup mx - if the final destination mail server is down or unreachable, backup MX servers will accept emails destined for the domain and then hold it in queue until the final destination server comes back online (for a certain period of time).

It is often recommended and generally agreed that SMTP servers should not accept email for any domain - only specific domains. SMTP servers that accept email for any domain are often referred to as "open relays" and are often blocked.