HomeBlogDemystifying DNS Records for Email: MX, A, CNAME, and TXT Explained
DNS 6 min read

Demystifying DNS Records for Email: MX, A, CNAME, and TXT Explained

A developer's deep dive by goodboycoder into Domain Name System records required for seamless email routing, server hosting, and domain verification.

goodboycoder
goodboycoder
Infrastructure Lead
Published on 2026-07-19

Demystifying DNS Records for Email: MX, A, CNAME, and TXT

When sending an email, your browser or mail client doesn't connect directly to an email address like user@company.com. Instead, it relies on the Domain Name System (DNS) to locate the exact mail server handling incoming messages for company.com.

In this tutorial, goodboycoder breaks down the DNS records required for reliable email routing.

MX Lookup Tool

Query live Mail Exchange (MX) records, priority scores, and server hostnames.

Try MX Lookup Tool

1. MX (Mail Exchange) Records

MX records specify the mail servers responsible for accepting incoming email messages on behalf of a domain.

Key Features of MX Records:

  • Priority: A numeric value assigned to each server. Lower numbers indicate higher priority (e.g. Priority 10 is tried before Priority 20).
  • Failover Routing: If the primary MX server is unreachable, backup mail servers queue incoming messages until the primary comes back online.

Query your domain's live MX records using our free MX Lookup tool.


2. A and AAAA Records

While MX records point to a domain name (like mail.company.com), an A record maps that domain name directly to an IPv4 address (e.g. 192.0.2.25), and a AAAA record maps it to an IPv6 address.


3. TXT (Text) Records

TXT records allow domain administrators to store arbitrary text strings in DNS. For email operations, TXT records are used for:

  • SPF Verification: Storing authorized sender IP addresses (use SPF Checker).
  • DKIM Public Keys: Storing cryptographic keys for signature verification (use DKIM Checker).
  • DMARC Policies: Instructing receivers on handling authentication failures (use DMARC Checker).
DNS Record Visualizer

Inspect A, AAAA, MX, TXT, and CNAME records simultaneously in one dashboard.

Try DNS Record Visualizer

4. Domain & SSL Security Verification

Always ensure your domain's WHOIS data and SSL certificates are active:

Test Your Domain Setup Live

Run real-time SPF, DKIM, DMARC, and DNS lookups on your own domain with 100% free developer tools.

Explore Tools