Definitions

What is MX (Mail Exchange)?

Last updated:

MX stands for Mail Exchange. It is a DNS record that specifies which mail server is responsible for receiving emails for a domain. Think of it as the postal address for your digital mailbox. When someone sends an email to mail@example.com, the sending mail server needs to know where to deliver that email. This information is stored in the MX record.

Together with DMARC, SPF and DKIM, the MX record forms the foundation of email delivery. DMARC, SPF and DKIM handle security and authentication. The MX record determines where emails should go. In this article we explain what an MX record is and how it works.

How does an MX record work

When an email is sent, the sending mail server goes through several steps:

  1. The server extracts the domain from the email address (the part after the @)
  2. It then queries the DNS of that domain for the MX record
  3. The MX record returns one or more mail servers with priorities
  4. The server attempts to deliver the email to the mail server with the highest priority (lowest number)
  5. If that server is unavailable, the sender tries the next server in the list

This process happens within seconds. It ensures that emails always reach the right destination, even if the primary mail server is temporarily unavailable.

The technical side of MX records

An MX record consists of two key components: a priority and a mail server. In your DNS, an MX record looks like this:

      example.com.    MX    10    mail.example.com.
example.com.    MX    20    backup.example.com.

    

MX priority explained

The number before the mail server is the priority. The lower the number, the higher the priority. Let's use the example above:

PriorityMail serverFunction
10mail.example.comPrimary mail server
20backup.example.comBackup mail server

Sending servers always try the server with the lowest priority first, for example 10. If it doesn't respond, the backup with priority 20 is tried. By setting up multiple MX records with different priorities, your email keeps working if a server goes down or is temporarily unreachable.

MX records and email delivery

MX records play an important role in email delivery. A misconfigured MX record means emails won't arrive. Keep the following in mind:

MX records must point to hostnames

An MX record should never point directly to an IP address. It must always refer to a hostname that then resolves to an IP address via an A record or AAAA record.

Correct:

      example.com.    MX    10    mail.example.com.

    

Wrong:

      example.com.    MX    10    192.0.2.1

    

Not receiving email with NULL MX (RFC7505)

Some domains are not meant to receive email. Think of domains that are only used for a website or redirect to another address. For these cases, the NULL MX record exists.

A NULL MX record looks like this:

      example.com.    MX    0    .

    

The priority is set to 0 (the highest possible). This ensures the record is always read first. The dot (.) indicates that the domain does not accept emails. This works better than having no MX record at all. It tells sending servers immediately that emails cannot be delivered, instead of them keeping trying. This prevents unnecessary mail bounces and reduces spam to non-existent addresses.

MX records and subdomains

Subdomains don't automatically inherit MX records from the main domain. If you want to receive emails at subdomain.example.com, you need to set up separate MX records for it.

At Lettermint we use subdomains for transactional emails. Read more about using subdomains in our article about email subdomains.

Setting up an MX record

You add an MX record in the DNS management of your domain. You need two pieces of information: a priority and the mail server where emails should go.

      @    MX    10    mail.example.com.

    

Example configurations

Some providers use multiple MX records as backup. If one server goes down, another takes over. Other providers like Microsoft handle this internally and only need one MX record.

Google Workspace

Emails first go to the server with priority 1. Is it unreachable? Then the servers with priority 5 are tried. Servers with the same priority are chosen randomly.

      @    MX    1     aspmx.l.google.com.
@    MX    5     alt1.aspmx.l.google.com.
@    MX    5     alt2.aspmx.l.google.com.
@    MX    10    alt3.aspmx.l.google.com.
@    MX    10    alt4.aspmx.l.google.com.

    

Microsoft 365

Microsoft 365 uses just one MX record. They handle backups internally.

      @    MX    0     example-com.mail.protection.outlook.com.

    

Cloudflare MX record

MX records and Lettermint

Lettermint is a service for sending emails. That's why you don't need to change any MX records to send with Lettermint. Your existing MX configuration for receiving emails stays the same.

What Lettermint needs for sending:

  • A DMARC record for authentication
  • A DKIM record for digital signatures
  • A bounce record for handling undelivered emails

These records are separate from your MX configuration. So you can use Lettermint for sending transactional emails while receiving emails through Google Workspace, Microsoft 365, or another email provider.

Receiving inbound emails

Lettermint also offers Inbound Emails that lets you process incoming emails via webhooks. By default, you receive an @inbound.lettermint.co address. This requires no MX record changes.

Want to receive emails on your own domain? Then you add an MX record pointing to Lettermint's inbound servers. This MX record must point exclusively to Lettermint. Also receiving emails through another provider like Google Workspace or Microsoft 365? Then use a subdomain like support.example.com for Lettermint's inbound.

Using a domain only for sending emails and not receiving any? It's still recommended to have an MX record. Some email providers like Microsoft factor this into their reputation assessment. A domain without an MX record can be seen as suspicious.

MX Check

Check below if your domain has correct MX records. Enter your domain to see which mail servers your emails are sent to.

MX Checker

Conclusion

The MX record is the foundation of email delivery. It determines where emails for your domain should go. Together with security protocols like DMARC, SPF and DKIM (and soon DKIM2), it ensures reliable email communication.

A correctly configured MX record ensures that:

  • Emails arrive at the right mail server
  • Backup servers take over if the primary server goes down
  • Sending servers know where to deliver emails

Check your MX records regularly, especially after changes to your email configuration. That way you won't miss any important messages.

Need more help?

Can't find what you're looking for?

If you couldn't find the information you were looking for, please don't hesitate to reach out to us. Our team is here to assist you with any questions you may have.