Main Hero

MX record

An MX record, or Mail Exchange record, is a type of DNS record that specifies which mail servers are responsible for receiving email on behalf of a domain. It directs incoming email traffic to the correct destination by identifying the mail server hostname and assigning it a priority value. When an email is sent to a domain, the sending mail server queries DNS to retrieve the MX records and determines where to deliver the message.

Each MX record includes a priority number, where lower values indicate higher preference. If the primary mail server is unavailable, secondary servers with higher priority values act as failover options. This ensures continuity of email delivery and reduces the risk of message loss during outages.

MX records are essential for any domain that sends or receives email. Without a correctly configured MX record, incoming messages cannot be routed properly, resulting in delivery failures. These records work alongside other DNS configurations such as SPF, DKIM, and DMARC to support secure and reliable email communication.

Advanced

MX records rely on proper hostname resolution, meaning each referenced mail server must have a valid A or AAAA record. Using IP addresses directly in MX records is not supported. Advanced configurations often include multiple MX records to support redundancy, load balancing, or geographic routing.

Priority structuring is critical. Misconfigured priorities can lead to unintended routing behaviour, such as backup servers handling primary traffic. In complex environments, MX records may point to email gateways, filtering systems, or security layers such as inbound relays before reaching the final mailbox server.

Integration with systems like spam filtering gateways, email security appliances, or cloud email platforms requires coordinated DNS, firewall, and routing configurations. Any mismatch between MX records and actual mail server availability can lead to delivery delays, soft bounces, or complete rejection.

Relevance

  • Enables proper routing of incoming email to the correct servers
  • Supports redundancy and failover for email infrastructure
  • Essential for maintaining reliable email communication
  • Works with authentication protocols to support email security

Applications

  • Configuring domains to receive email via providers such as Microsoft 365 or Google Workspace
  • Routing email through filtering gateways or security appliances
  • Setting up backup mail servers for high availability
  • Managing multi server or hybrid email environments

Metrics

  • Email delivery success rate
  • Mail server uptime and failover performance
  • Bounce rates related to routing issues
  • Latency in email delivery across MX priorities

Issues

  • Incorrect MX records causing email delivery failure
  • Missing or invalid hostnames preventing resolution
  • Misconfigured priorities leading to inefficient routing
  • Lack of redundancy increasing risk of downtime

Example

A company uses a cloud email provider for primary mail handling and a secondary backup server for redundancy. The MX record assigns the cloud provider a lower priority value and the backup server a higher one. If the primary service becomes unavailable, incoming emails are automatically routed to the backup system, ensuring continuity.