Definition
An MX (Mail Exchanger) record is a DNS entry that tells the world which mail server is responsible for accepting email for a domain. When someone sends a message to [email protected], the sending server queries DNS for the MX records of example.com and delivers the message to the host they point to, often a Google Workspace, Microsoft 365, Fastmail or Zoho Mail address. Each MX record has a priority number, lower is preferred, and a target hostname that must itself resolve via an A or AAAA record. A domain typically carries 2 to 5 MX records, so backup mail servers accept mail if the primary is unreachable, though most small domains only need one provider's set. MX records are completely independent from a domain's web hosting: you can host your website with one provider and email with another, and moving one without carrying across the other is the single most common cause of email outages after a DNS migration.
How it works
An MX record has a priority number (lower = preferred) and a target hostname. The target must itself have an A or AAAA record. A domain typically has 2 to 5 MX records for redundancy, all pointing at the email provider's mail servers.
Why it matters
Email and web hosting are completely separate concerns at the DNS level, and forgetting that is the classic cause of "I moved my website and now my email is broken". When you change DNS providers or hosting, your MX records must be carried across or email stops working.