Hosting Cost
Beginner Domains & DNS

What Is an MX Record?

Elena Novak, WordPress & Managed Editor
Elena Novak

WordPress & Managed Editor

Disclosure: Some links on this page are affiliate links — if you sign up through one, we may earn a commission at no extra cost to you. It never changes our ratings, rankings or verdicts: we don't sell hosting and take no pay-for-placement.

Who it's for

  • Business owners setting up custom email
  • DIY site builders
  • Anyone troubleshooting domain email

What Is an MX Record?

An MX record (“Mail Exchange” record) tells other mail servers where to deliver email for a domain. When someone sends a message to hello@example.com, the sending mail server looks up example.com’s MX record to find the destination mail server’s hostname. This is different from looking up a regular A record, which handles web traffic instead.

How an MX Record Works

Every domain that receives email needs at least one MX record, pointing to a mail server hostname. That hostname then has its own A record resolving to the mail server’s actual IP address. The MX record itself never contains an IP directly, only a hostname. A domain can list multiple MX records, each with a priority number. Lower numbers are tried first, and higher-numbered entries act as backups if the primary server is unreachable.

a hand holding an iPhone up to a laptop on a bright desk, the laptop showing a webmail and email settings screen with a short list of mail s

Step-by-Step: Setting Up an MX Record

  1. Get the mail server hostname(s) and priorities from the email hosting provider — this could be the same host as the website, or a dedicated email hosting service.
  2. Log in to the DNS management panel.
  3. Create the MX record, usually on the root domain (@) unless email is set up on a specific subdomain.
  4. Enter the mail server hostname as the value, and the priority number provided.
  5. Add any backup MX records, with higher priority numbers, if the provider supplies them.
  6. Save and wait for propagation before testing delivery.
  7. Send a test email to and from the domain once propagation has had time to complete.

Timing and Propagation

Some mail servers cache MX lookups conservatively for deliverability reasons. This means MX record changes can sometimes take longer to be fully trusted across the internet than a typical web-facing record change — often the full propagation window rather than the fastest end of it. During a switch, keeping the old mail server briefly reachable, if possible, avoids bounced messages sent by servers still using a cached, older MX value.

a bright home studio desk with a laptop, a tablet showing a colourful mockup and a small potted succulent, warm window light

Field Reference

  • Name/Host — usually @ for the root domain, unless email routes through a subdomain.
  • Type — MX.
  • Value — the mail server’s hostname (never a bare IP address).
  • Priority — a number where lower is tried first; used to set primary and backup mail servers.
  • TTL — cache duration in seconds.

See the full comparison against A and CNAME records at DNS record types.

a cafe table by a window with a flat white in a ceramic cup, a notebook and a pen, soft warm daylight

Troubleshooting MX Record Issues

  • Email bouncing entirely: check that an MX record exists at all. It’s easy to accidentally omit when setting up DNS manually, or to lose when changing nameservers.
  • Email intermittently failing: often a sign of a misconfigured priority order, or a backup MX server that’s not actually functional.
  • Email stopped working after switching hosts: a very common cause is nameserver changes wiping out the previous MX records without recreating them at the new provider. See hosting email not working for the full troubleshooting path.
  • MX record entered but pointing at an IP address: this is invalid. The value must be a hostname with its own A record, not a bare IP.

Relationship to Hosting

The MX record is what makes email hosting work, independent of whatever handles the domain’s website. It’s entirely possible — and common — for web hosting and email hosting to run on completely different providers for the same domain. The two are connected only by separate A and MX records pointing to each one. This is also why best email hosting is frequently chosen independently of the web host, for stronger deliverability and mailbox features than a bundled “free” email add-on typically offers.

FAQ

Can I use the same server for both my website and email? Yes — many hosts bundle both, with the A record pointing to the web server and the MX record pointing to the same or a related mail server hostname.

What happens if I don’t set an MX record? The domain simply can’t receive email. Messages sent to any address at that domain will bounce, even if the website itself works fine.

Why does my MX record need a priority number? Priority lets a domain list backup mail servers; if the lowest-priority (primary) server is unreachable, sending servers try the next one up.

Do I need to update my MX record when I switch web hosts? Only if email is also moving to the new host. If email hosting stays with its current provider, the MX record shouldn’t be changed during a web-only host switch.