Essential DNS Records for Email
MX Records (Mail Exchanger)
MX records tell other servers where to deliver email for your domain. They point to mail servers that accept incoming email.
yourdomain.com MX 10 mail.yourdomain.com
The number (10) is priority. Lower numbers have higher priority. If you use multiple mail servers, different priorities enable failover.
You need MX records only if you receive email at your domain. If you only send (like a marketing-only subdomain), MX records are optional.
SPF Record (Sender Policy Framework)
SPF authorizes which IP addresses can send email from your domain. It is a TXT record that lists approved senders.
yourdomain.com TXT "v=spf1 include:emailprovider.com -all"
Components explained:
v=spf1- SPF versioninclude:- Authorizes another domain's SPF record-all- Reject email from unauthorized sources
You can have only one SPF record per domain. Combine multiple senders with multiple include statements.
DKIM Record (DomainKeys Identified Mail)
DKIM adds a cryptographic signature to your emails. The public key is published in DNS so receivers can verify the signature.
selector._domainkey.yourdomain.com TXT "v=DKIM1; k=rsa; p=MIGfMA0..."
Your email platform provides the specific DKIM record to add. The selector is unique to each platform or configuration.
DMARC Record
DMARC tells receivers what to do when SPF or DKIM fail, and where to send reports.
_dmarc.yourdomain.com TXT "v=DMARC1; p=none; rua=mailto:[email protected]"
Policy options:
p=none- Monitor only, do not rejectp=quarantine- Send failures to spamp=reject- Block failures entirely
Additional Helpful Records
A Record
Maps your mail server hostname to an IP address. Required if your MX record points to a hostname on your domain.
mail.yourdomain.com A 192.0.2.1
PTR Record (Reverse DNS)
Maps your sending IP back to a hostname. Set by your hosting provider, not in your domain DNS. Important for dedicated IP senders.
CNAME Records
Some email platforms use CNAME records for DKIM or tracking domains instead of TXT records. Follow your provider's specific instructions.
Records for Sending vs Receiving
If You Only Send Email
Required: SPF, DKIM, DMARC
Optional: MX (for bounce handling), A record
If You Send and Receive
Required: MX, SPF, DKIM, DMARC, A record for mail server
Common Configuration Mistakes
- Multiple SPF records: You can only have one SPF record. Combine all senders in one record.
- Too many SPF lookups: SPF allows maximum 10 DNS lookups. Exceeding this causes failures.
- Wrong DKIM selector: Each platform has unique selectors. Use exactly what they provide.
- Missing DMARC: Required by Gmail and Yahoo for bulk senders since 2024.
- Typos in records: DNS is unforgiving. Double-check every character.
