Mail Exchanger MX Record: How Your Domain Receives Email

If email suddenly stops arriving at your domain, there is one DNS setting that is almost always the culprit, and most people do not even know it exists. The mail exchanger MX record is the single instruction that tells the entire internet which server is allowed to receive email for your domain. Get it right and mail flows in quietly and reliably. Get it wrong, leave it blank, or let it point at an old provider, and every incoming message bounces or vanishes while your website keeps working perfectly, which is exactly why the problem is so confusing when it happens.

This guide explains what an MX record actually is, how it routes incoming mail, what priority values do, how MX records differ from A records, and how to check and fix yours when something goes wrong.

Key Takeaways
• An MX (Mail Exchanger) record is a DNS record that tells sending mail servers which server handles email for your domain.
• It points to a hostname, never directly to an IP address; that hostname is resolved separately by an A record.
Priority values rank multiple MX records: a lower number means higher priority, so mail tries the lowest first and falls back to higher numbers.
• Your domain’s website (A record) and email (MX record) are routed completely separately, so they can point to two different providers.
• Missing, wrong, or stale MX records are the most common reason incoming email silently fails after a host change.

What is a mail exchanger MX record?

A mail exchanger MX record is a type of DNS record that specifies the mail server responsible for accepting email on behalf of your domain. The “mail exchanger” is simply the server that exchanges (receives) mail for `yourdomain.com`.

When someone types your address into their email program and hits send, their mail server has no idea where your inbox lives. It only knows the part after the `@`: your domain name. To find your mailbox, the sending server queries DNS and asks a specific question: *”What is the MX record for this domain?”* The answer is a hostname pointing to the server that should receive the message.

Without an MX record, the sending server has no destination, and the message cannot be delivered. The MX record is the address label the world’s mail servers read before dropping your mail.

How does an MX record actually route email?

The journey of an incoming email follows a predictable path:

  1. Someone sends a message to `[email protected]`.
  2. Their outgoing (sending) mail server extracts the domain `yourdomain.com`.
  3. It performs a DNS lookup for that domain’s MX record.
  4. DNS returns one or more mail server hostnames, each with a priority value.
  5. The sending server connects to the lowest-priority-number host and delivers the message over SMTP.
  6. Your mail server accepts the message and files it into your mailbox.

A real MX record, written in standard DNS zone format, looks like this:

“`dns ; Type Name Priority Value (mail host) yourdomain.com. IN MX 10 mail.yourdomain.com. yourdomain.com. IN MX 20 backup-mail.yourdomain.com. “`

Here, `yourdomain.com` has two mail exchangers. The host `mail.yourdomain.com` has priority `10` and is tried first. If it is unreachable, the sending server falls back to `backup-mail.yourdomain.com` at priority `20`.

What do MX record priority values mean?

Priority values let you list multiple mail servers and control the order in which sending servers try them. The rule is simple but counterintuitive: a lower number means a higher priority.

A sending server always attempts the MX record with the lowest priority number first. If that server does not respond, it moves to the next-lowest, and so on. This is how email failover works: your primary mail server handles normal traffic, and one or more fallback servers catch mail during outages so messages queue instead of bouncing.

Priority value Role When it is used
`10` Primary mail exchanger First choice for all incoming mail
`20` Secondary / backup Used only if priority 10 is unreachable
`30` Tertiary / backup Used only if 10 and 20 are both down

If two MX records share the same priority number, sending servers distribute mail between them, which can be used for simple load balancing. Most small domains only need a single MX record; the priority number on its own still matters, but with one record there is nothing to fall back to.

How is an MX record different from an A record?

This is the distinction that trips up the most people, so it deserves its own section.

An A record maps a hostname directly to an IP address. An MX record maps your domain to a hostname, and that hostname is then resolved to an IP through its own A record. In other words, MX records never point at an IP address directly; they always point at a name.

Feature A record MX record
Points to An IP address (e.g. `203.0.113.10`) A hostname (e.g. `mail.yourdomain.com`)
Job Sends web visitors to your web server Sends incoming email to your mail server
Used by Browsers, web clients Sending mail servers (SMTP)
Has priority? No Yes (lower number wins)

The reason MX records point at a hostname rather than an IP is flexibility. If your mail provider changes the IP of their servers, they only update the A record behind the hostname; your MX record never has to move. For more on how the different record types fit together, see .

How do you set up email by setting MX records?

Setting up email for your domain is, at its core, the act of pointing your MX records at your email host. The provider gives you the mail server hostnames and priority values to use, and you enter them in your domain’s DNS zone.

A typical setup follows these steps:

  1. Choose an email host and create your mailboxes.
  2. Get the MX hostnames and priorities from that provider.
  3. Open your domain’s DNS management panel.
  4. Remove any old MX records left over from previous providers.
  5. Add the new MX records exactly as supplied.
  6. Add the matching authentication records (SPF, DKIM, DMARC) so your outgoing mail is trusted.
  7. Wait for propagation, then test by sending mail to your domain.

That removal step in the middle is the one most people skip, and it causes more delivery problems than any other mistake. For a full walkthrough of the whole process, see .

The MX record is the single DNS setting that decides whether your email works at all, and it is the one people forget exists until mail mysteriously vanishes. Here is the crucial mental model: your domain’s website and your domain’s email are routed completely separately by DNS. The A record sends web visitors to your web server, while the MX record sends incoming email to your mail server, and these can (and often should) point to two entirely different places. That separation is why you can host your website with one provider and your email with another, why changing your web host does not have to touch your email, and, the painful flip side, why moving hosts and forgetting to set the MX records means your website works perfectly while every incoming email silently bounces or disappears. So when email stops arriving, the MX record is the first thing to check. It is the address label that tells the world’s mail servers where to drop your mail, and if it is wrong, missing, or still pointing at an old host, no email reaches you no matter how perfect everything else is.

What are the most common MX record mistakes?

A handful of errors account for the vast majority of broken email:

  • Missing MX record. With no MX record, sending servers have nowhere to deliver mail. Some will fall back to the domain’s A record (a legacy behaviour), but you should never rely on that. No MX usually means no incoming email.
  • Wrong hostname. A typo in the mail host, or a hostname from a provider you no longer use, sends mail to the wrong place or to a server that rejects it.
  • Conflicting MX records from an old host. When you switch email providers, the previous provider’s MX records often stay behind. Sending servers may still deliver to the dead host, so mail lands in an inbox you can no longer access, or bounces outright.
  • Pointing to an IP address instead of a hostname. MX records must reference a name, not an IP. An IP in the value field is invalid and breaks delivery.
  • Trailing dot or formatting errors. Some DNS panels require a fully qualified hostname; small syntax issues can stop mail cold.

When mail stops arriving, work through this list in order before assuming the problem is anything more complicated.

How do MX records relate to SPF, DKIM, and DMARC?

It is easy to lump all email-related DNS records together, but they do fundamentally different jobs, and understanding the split removes a lot of confusion.

  • MX records route incoming mail. They tell the world where to *deliver* messages addressed to your domain.
  • SPF, DKIM, and DMARC authenticate outgoing mail. These are TXT records that prove messages *sent from* your domain are legitimate, which keeps them out of recipients’ spam folders and protects your domain from spoofing.

In short, MX is about *receiving*, while SPF/DKIM/DMARC are about *sending and trust*. A domain can have a perfect MX record and still have its outgoing mail rejected because the authentication records are missing, and vice versa. Both halves matter for a healthy mail setup. For the authentication side, see , and for how mail is actually transmitted, see .

How do you check your domain’s MX records?

You can inspect any domain’s MX records from the command line in seconds. Two tools cover almost every system.

On Linux or macOS, use `dig`:

“`bash dig MX yourdomain.com +short “`

A typical response looks like:

“`text 10 mail.yourdomain.com. 20 backup-mail.yourdomain.com. “`

On Windows (or anywhere `dig` is unavailable), use `nslookup`:

“`bash nslookup -type=mx yourdomain.com “`

Both commands show the priority numbers and mail host hostnames currently published for the domain. If the output is empty, the domain has no MX record. If it shows a host you do not recognise, you have a stale or conflicting record to clean up. This single check is the fastest way to diagnose a sudden email outage.


Reliable MX records with DarazHost email hosting

DarazHost sets your MX records correctly when you use our email hosting, so incoming mail reliably reaches your mailboxes from day one. Our easy DNS management lets you view or adjust your MX records whenever you need to, with proper SPF, DKIM, and DMARC configured alongside them so your outgoing mail is trusted too. Changes propagate quickly, and our 24/7 support team is on hand to get your MX records right the first time. The result is email that simply arrives, without the silent bounces and mystery outages that come from misconfigured DNS.


What happens to email during MX propagation?

When you change your MX records, the update does not reach every mail server on the internet instantly. DNS resolvers around the world cache records for a period defined by the record’s TTL (time to live), so older cached values can linger until that timer expires.

During this propagation window, some sending servers will use your new MX record while others still use the old one. In practice, mail can arrive at both your new and old mail servers for a short time. To minimise disruption when migrating:

  • Lower the TTL on your MX records a day or two before the change, so caches expire faster.
  • Keep mailboxes on the old host active until propagation completes.
  • Test delivery from several outside addresses after the change.

Most MX changes settle within a few hours, though full global propagation can take up to 48 hours depending on TTL settings. Patience during this window prevents the panic of thinking the new setup has failed when it is simply still propagating.

Frequently asked questions

Can a domain have more than one MX record? Yes. Multiple MX records with different priority values provide failover. Mail tries the lowest priority number first and falls back to higher numbers if that server is unreachable.

What happens if a domain has no MX record? Incoming email generally cannot be delivered. Some sending servers fall back to the domain’s A record as a legacy behaviour, but this is unreliable, so a domain that needs to receive mail should always have an explicit MX record.

Can my website and email be hosted with different providers? Yes, and this is very common. The A record routes web traffic and the MX record routes email completely independently, so you can host your site with one provider and your mailboxes with another.

Why does my website work but my email stopped after switching hosts? This is the classic symptom of missing or stale MX records. The new host updated your A record for the website but the MX records were never set, or still point at your old provider, so incoming mail has nowhere valid to go.

How long do MX record changes take to work? Usually a few hours, but global propagation can take up to 48 hours depending on the TTL set on the records. Lowering the TTL before making changes speeds this up.


This article is part of our email hosting cluster. For the full picture, read the pillar guide: Business Email Hosting: The Complete Guide to Professional Email on Your Own Domain.

About the Author

Leave a Reply