Kamran Mushtaq
Back to Hosting & Deployment
Hosting & Deployment

MX (Mail Exchange) Record

Added: June 25, 2026

Definition

MX (Mail Exchange) Record is a DNS record that tells the internet which mail server should receive emails for a domain. It sits in this flow: Domain → Nameserver → DNS Records → MX Record → Mail Server When someone sends an email to user@example.com, the sender's mail server checks the domain's MX record to find the correct destination mail server. Key terms: DNS, Mail Server, Email Routing, SMTP, Priority, Domain Name.

What Problem It Solves

Without MX records, the internet would know where your website lives (A Record), but not where your emails should go. It provides a standard way to route emails to the correct mail service such as Google Workspace, Microsoft 365, or a custom mail server.

What Happens If Not Used

Emails sent to your domain may:

  • Bounce back to the sender.
  • Get lost.
  • Never reach your inbox. Your website can still work, but email delivery becomes unreliable or impossible.

Easy Wording

An MX record is the DNS instruction that tells the internet which mailbox building should receive your domain's emails.

Layman Example

Imagine sending a letter to a company.

  • The company name = Domain
  • The office building = Mail Server
  • The address directory = MX Record The post office checks the directory to find the correct building before delivering the letter.

Technical Example

Before MX Record Is Used

  • Alice sends email to info@example.com.
  • Her mail server knows only the domain name.
  • It needs to find where emails for example.com should be delivered.

After MX Record Is Used

  • Alice's mail server queries DNS for example.com.
  • Nameserver returns: MX 10 mail.example.com
  • DNS then resolves mail.example.com to an IP address.
  • Alice's mail server connects to that mail server using SMTP.
  • The mail server accepts and stores the email in the recipient's mailbox.

Flow: Sender Mail Server → DNS Query → MX Record → Mail Server Address → SMTP Connection → Recipient Mailbox.