← Lessons

quiz vs the machine

Silver1080

Networking

The DNS MX Record

How a sending server discovers where to deliver your mail.

4 min read · intro · beat Silver to climb

Routing Mail by Domain

Email addresses end in a domain, but mail does not go to a bare domain. The sending server queries DNS for the domain's MX record (mail exchanger) to learn which host accepts mail for it.

What an MX Record Holds

  • A priority number, where a lower value is preferred.
  • A hostname that itself resolves to an address through an A or AAAA record.
  • Multiple MX records for redundancy across mail servers.

Choosing a Server

When several MX records exist, the sender tries the lowest priority first. If that host is unreachable, it falls back to the next. Equal priorities allow simple load spreading. If no MX record exists, some senders fall back to the domain's A record, but relying on that is fragile.

Key idea

An MX record tells a sending server which host accepts mail for a domain, with priority numbers ordering preference and providing backup paths.

Check yourself

Answer to earn rating on the learn ladder.

1. In MX records, which priority is preferred?

2. What does an MX record point to?