What is an MX record

If you have ever sent an email to someone@yourbrand.com and wondered how the message finds its way to the right inbox, the answer is DNS. Specifically, the MX record. Without it, email sent to your domain has nowhere to go. Messages bounce back to the sender with a delivery failure error, even if your website loads perfectly fine.

What is an MX record?

MX stands for mail exchange. An MX record is a DNS record type that tells sending mail servers which server is responsible for receiving email on behalf of your domain. When someone sends a message to hello@yourbrand.com, their mail server looks up the MX record for yourbrand.com and delivers the message to the server listed there.

Unlike an A record, which stores an IP address directly, an MX record stores a hostname (like mail.yourbrand.com). That hostname then resolves through its own A record to an IP address. This two-step lookup gives email providers flexibility to change server addresses without updating every customer's MX record.

How does an MX record work?

The delivery process follows a clear sequence.

  1. A sender composes an email to an address at your domain and their mail server accepts it for delivery.
  2. The sending server queries DNS for the MX record of your domain.
  3. DNS returns one or more MX records, each with a priority value and a hostname.
  4. The sending server connects to the hostname with the lowest priority number (highest priority).
  5. If that server is unreachable, the sender tries the next MX record in priority order.
  6. Once connected, the receiving server accepts the message and places it in the correct mailbox.

This process runs automatically for every email sent to your domain. You configure the MX record once in your DNS panel, and every mail server worldwide uses it to route messages correctly.

What is MX priority?

Each MX record includes a priority value, a number that determines which mail server receives email first. Lower numbers mean higher priority.

If your domain has two MX records, one with priority 10 and one with priority 20, sending servers always try the priority 10 server first. The priority 20 server acts as a backup. If the primary server is down or unreachable, mail flows to the backup automatically.

Most small brands need only one MX record. Multiple records with different priorities are common for larger organizations that want redundancy. Your email provider tells you exactly which MX records and priority values to use.

How is an MX record different from an A record?

Both are DNS records, but they serve different purposes and store different values.

  • A record: Maps a domain to an IP address for website traffic
  • MX record: Maps a domain to a mail server hostname for email delivery

Changing your A record to point your website at a new host does not affect email, as long as you leave your MX records untouched. This is a common source of confusion during hosting migrations. People update their web records and accidentally delete or modify their MX records at the same time, breaking email delivery.

Always verify your MX records before and after any DNS change. If email stops working after a migration, the MX record is the first thing to check.

How to set up an MX record

Setting up an MX record follows the same process as any DNS change. Log in to wherever your DNS is managed, create a new record, select MX as the type, and enter the values your email provider gives you.

You typically need the mail server hostname and a priority number. Some providers give you multiple MX records for redundancy. Add each one exactly as specified. Do not guess hostnames or priority values.

If you are setting up email for the first time, the chapter on how to set up email on your domain covers the full process from choosing a provider to verifying delivery.

Common MX record mistakes

Deleting MX records during a web migration. When you update A records to point your website at a new host, your MX records must stay exactly as they were. Double-check them after every DNS change.

Using the wrong hostname. MX records point to a hostname, not an IP address. Entering an IP address directly in an MX record field will not work. Use the mail server hostname your email provider specifies.

Conflicting MX records. If old MX records from a previous email provider remain alongside new ones, mail may split between two systems. Remove old MX records completely before adding new ones.

Not lowering TTL before switching email providers. Just like A record changes, MX record updates depend on TTL for propagation speed. Lower TTL on your MX records a day or two before switching providers to minimize delivery gaps.

How WEMASY handles email DNS

WEMASY includes everything you need to run a professional website on your own domain. When you connect a custom domain, the platform guides you through the DNS records required for your site, including any email-related configuration your plan supports.

Domain management, hosting, SSL, and your website builder all live in one WEMASY subscription. See what is included on the WEMASY pricing page.

What comes next

With your MX record configured, email sent to your domain reaches the right server. For the web side of DNS, revisit what an A record is, or follow the guide on how to set up email on your domain for the complete email setup process.

Frequently asked questions

Can I use the same domain for both website and email?

What happens if I have no MX record?

Can I point MX records to an IP address?

How many MX records can a domain have?

Will changing my A record break my email?

How long does an MX record change take to propagate?