Home/Glossary/MX Record

MX Record

A DNS record type that specifies which mail servers are responsible for receiving email for a domain.

NetworkingAlso called: "mail exchange record", "mail exchanger"

MX (Mail Exchange) records direct email traffic to the correct mail servers, with priority values determining the order servers are tried.

How MX records work

  • When sending email to [email protected], the sender's server queries DNS for example.com's MX records.
  • DNS returns a list of mail servers with priority values (lower = higher priority).
  • The sender connects to the highest-priority server; if unavailable, tries the next.
  • The receiving server accepts the email for local delivery.

MX record format

example.com.  IN  MX  10  mail1.example.com.
example.com.  IN  MX  20  mail2.example.com.
example.com.  IN  MX  30  backup.example.com.

Priority values

  • Lower numbers = higher priority (tried first).
  • Equal priorities = random distribution (load balancing).
  • Higher numbers = backup servers used when primary fails.
  • Typical values: 10, 20, 30 (allows room for additions).

Common configurations

  • Cloud email: Points to provider (aspmx.l.google.com, mail.protection.outlook.com).
  • Email gateway: Points to security vendor for filtering before delivery.
  • Hybrid: Mix of cloud and on-premises servers.
  • Backup: Secondary MX at higher priority for redundancy.

Security implications

  • Changing MX records affects all email routing for the domain.
  • Attackers may monitor MX records to identify email infrastructure.
  • Misconfigured MX records can cause email delivery failures.
  • SPF records must authorize MX servers to send email.