MX Records vs. A Records

MX records (Mail Exchange records) specify which mail servers are responsible for receiving email for a domain. A records (Address records) map a domain or subdomain directly to an IPv4 address and are primarily used to route web traffic. 

In short, MX records are required for email delivery, while A records power websites.

Key Differences

Function

  • A Record: Maps a domain to an IP address

    • Example: example.com → 192.0.2.1

  • MX Record: Maps a domain to a mail server hostname (not an IP)

    • Example: example.com → mail.example.com

Purpose

  • A records connect users to websites and services.

  • MX records route inbound email to the correct mail server.

Structure

  • MX records include a priority value (lower numbers have higher priority) to define mail server order and failover.

  • A records do not use priority values.

Relationship

  • An MX record must point to a hostname, and that hostname must resolve via an A or AAAA record.

Usage Example

  • A Record:
    example.com → 203.0.113.1 (Web server)

  • MX Record:
    example.com → mail.example.com (Mail server hostname)

  • A Record:
    mail.example.com → 203.0.113.5 (Mail server IP)

Provider Flexibility

MX records can point to external, third-party email providers (such as Google Workspace or Microsoft 365), while A records often point to local or separate hosting environments. This allows websites and email services to be managed independently.

burritos@banana-pancakes.com braunstrowman@banana-pancakes.com finnbalor@banana-pancakes.com ricflair@banana-pancakes.com randysavage@banana-pancakes.com