Mail Exchange (MX) Record FAQ

Also see: How to Use an Outside Email Server, Types of DNS Records, and Editing DNS Settings

What is a mail exchange?

"Mail exchange" is just another name for the machine whose primary function is receiving and sending email. Also known as mailhost, mailhub, or even postoffice, this machine usually has a mail server (software written specifically for distributing files) listening on port 25 to receive incoming email.


What is a Mail Delivery Agent? (How is email delivered?)

A Mail Delivery Agent (MDA) is the "postal worker" software that looks at the address and either drops it into the local user's mailbox or tosses it back on the "truck" for delivery elsewhere. In other words, the MDA reads the header and decides whether it needs to be put in a mailbox on its own machine or sent back out over the Internet to a remote machine.


What is an MX record?

An MX (Mail eXchange) record will redirect email sent to any user's machine ( for example) to a designated mailhost. It tells the MDA where to route email.

The MX record uses preference values to specify the routing order--low value = high priority. In the example below, when mail is sent to the MDA (see Mail Delivery Agent above) tries to reroute the mail to which has the lowest value, and therefore the highest priority. If that fails, it tries and finally
  86400   A

  86400   MX   10   86400   MX   20   86400   MX   30


What is a "dangling" MX record?

An MX record can exist for a host that is not registered or no longer registered. For example, if people have become used to sending email to Joe at, and the host mail2 dies or is decommissioned, Joe can still receive mail at his old address if you retain an MX record for mail2 that redirects the mail to a new address. We recommend this option be used sparingly because it may cause confusion in users who don't have understand how mail to a non-existant host can still be delivered.


What is a domain MX record?


A domain MX record will redirect mail sent to to a designated mailhost. The MX record is attached only to the domain name ( If a host exists with the same name as the domain, a "dangling" MX record is created which is not attached to any existing host. In either case, mail directed to the domain name is redirected to the mail exchange defined in the MX record. This does not effect mail sent directly to individual hosts in the domain.

For example, if a domain MX exists for, with a mail exchange of, then mail to will be delivered to


What is a domain-wide MX record?



A domain-wide MX record gets attached to every registered host in the domain. This function allows mail to be delivered to a central mailhost when incorrectly configured hosts may direct the reply mail back to the local machine. Some administrators discourage the use of incoming sendmail service on individual machines as this has been historically a method for system compromise. Frequently, sendmail is turned off on individual machines and mail is redirected back to a more secure central mailhost. Since users may have published a local version of their email address, it is important to redirect the email to prevent a break in mail service.

For example, if a domain-wide MX record exists for, with a mail exchange of, then mail to will be delivered to