New: Post-Quantum Cryptography tools — is your domain quantum-safe? Check now

dns

MX Lookup

Check mail exchange records for a domain

What You Need to Know

What This Tool Does

MX Lookup queries the Mail Exchange (MX) records for a domain to find which mail servers are responsible for receiving emails. These DNS records specify the mail servers and their priority order.

Why It Matters

  • Email Delivery: Ensures emails reach the correct mail servers for your domain
  • Redundancy: Multiple MX records provide backup if the primary server fails
  • Security: Helps identify unauthorized or misconfigured mail servers
  • Troubleshooting: Essential for diagnosing email delivery problems

How to Read the Results

  • Priority: Lower numbers = higher priority (10 is processed before 20)
  • Exchange: The hostname of the mail server that receives emails
  • Multiple Records: Having 2-3 MX records provides redundancy and reliability
  • TTL: Time To Live - how long DNS servers cache this information

Technical Background

Mail Exchange (MX) records are defined in RFC 5321 and RFC 1035 as DNS resource records that specify the mail servers responsible for accepting email messages for a domain. Each MX record contains two fields: a priority value (16-bit unsigned integer, lower = higher priority) and a mail server hostname. When a sending mail server needs to deliver email, it performs a DNS MX lookup for the recipient domain, sorts results by priority, and attempts SMTP connection (TCP port 25) to each server in order. Multiple MX records provide redundancy: if the primary server (priority 10) is unreachable, delivery falls back to the secondary (priority 20). MX records must point to A/AAAA records — never directly to IP addresses or CNAME chains. Properly configured MX records are a prerequisite for DKIM signing, SPF validation, and DMARC policy enforcement. The SMTP protocol (RFC 5321) defines the full delivery handshake: EHLO/HELO, MAIL FROM, RCPT TO, DATA, and QUIT. Mail servers may support STARTTLS (opportunistic TLS upgrade, RFC 3207) or use port 465 (SMTPS) for implicit TLS. Modern email security requires that MX records point to hosts with valid PTR (reverse DNS) records, properly configured TLS certificates, and SMTP banner hostnames that match the reverse DNS — violations can trigger spam filters. Common MX configuration patterns include: Google Workspace (aspmx.l.google.com with priorities 1, 5, 10, 10, 10), Microsoft 365 (domain-com.mail.protection.outlook.com at priority 0), and self-hosted Postfix/Exim/Sendmail. Misconfigured MX records are one of the top causes of email delivery failures — organizations may accidentally point to decommissioned servers, have missing or expired PTR records, or have firewall rules blocking port 25 inbound. Regular MX health checks help proactively catch these issues before they result in bounced or undelivered email. When diagnosing email delivery issues, MX record verification is always the first step. Administrators should confirm: (1) all MX hostnames resolve to valid A/AAAA records, (2) SMTP port 25 is reachable on each MX host, (3) reverse DNS (PTR records) match the forward hostname, (4) TLS certificates on MX hosts are valid and not expired. Tools like mxtoolbox.com, dmarcanalyzer.com, and this tool provide automated verification. Email providers like Gmail and Outlook increasingly reject mail from senders with DNS misconfigurations, making regular MX audits essential for maintaining email deliverability.

Command-Line Usage

Run equivalent checks directly from your terminal on macOS, Windows, or Linux.

🍎 macOS

# Query MX records with dig (macOS)
dig MX example.com
# Short output only
dig MX example.com +short
# Query specific DNS server
dig @8.8.8.8 MX example.com +short

🪟 Windows (PowerShell / CMD)

# nslookup MX query
nslookup -type=MX example.com
# PowerShell MX lookup
Resolve-DnsName -Name example.com -Type MX

🐧 Linux

# dig MX with full output
dig MX example.com
# host command for MX
host -t MX example.com
# Query via Cloudflare DNS
dig @1.1.1.1 MX example.com +short

Input Parameters

Enter a domain name without http:// or www

Tool Status: Ready

Developer

API & CLI Usage

API Endpoint

POST /api/tools/mx-lookup

Platform-Specific Examples

Bash (curl)
curl -X POST https://epcybertools.com/api/tools/mx-lookup \
  -H "Content-Type: application/json" \
  -d '{"domain":"google.com"}'
wget
wget --method=POST \
  --header="Content-Type: application/json" \
  --body-data='{"domain":"google.com"}' \
  -O - https://epcybertools.com/api/tools/mx-lookup
HTTPie (apt install httpie)
http POST https://epcybertools.com/api/tools/mx-lookup \
  domain="google.com"
View full API documentation →