SPF, DKIM and DMARC explained — and how to set them up
What each email authentication record does, how they work together, and a step-by-step setup for any DNS provider.
Email was designed in an era when everyone on the network trusted each other. SPF, DKIM and DMARC are the three standards that bolt identity on after the fact. You need all three.
SPF: who may send
Sender Policy Framework is a TXT record listing the servers allowed to send mail for a domain. Receivers check it against the envelope sender (the return path), not the visible From address.
send.acme.com TXT "v=spf1 include:amazonses.com ~all"
A domain can only have one SPF record, and SPF evaluation may perform at most 10 DNS lookups. If you use several providers, merge them into a single record.
DKIM: proof the message is genuine
DomainKeys Identified Mail signs each message with a private key; receivers fetch the public key from DNS to verify it. A valid signature proves the content was not changed in transit and that the domain owner authorised it.
Stack Emails uses Easy DKIM with 2048-bit keys, published as three CNAME records so keys can be rotated without you touching DNS again:
abc123._domainkey.acme.com CNAME abc123.dkim.amazonses.com
DMARC: the policy
Domain-based Message Authentication, Reporting and Conformance ties the two together. It tells receivers what to do with mail that fails aligned SPF or DKIM, and where to send aggregate reports.
_dmarc.acme.com TXT "v=DMARC1; p=none; rua=mailto:dmarc@acme.com"
Start with p=none to collect reports without affecting delivery. Once every legitimate source passes, move to p=quarantine and eventually p=reject.
Setting it up with Stack Emails
- In the dashboard, open Domains → Add domain and enter the domain (a subdomain like
mail.acme.comis recommended). - Copy the generated records: three DKIM CNAMEs, an MX and SPF TXT record for the custom return path, and a DMARC TXT record.
- Add them at your DNS provider. For Cloudflare, set CNAMEs to DNS only (grey cloud). For Hostinger and GoDaddy, enter only the host part (e.g.
abc123._domainkey) — the panel appends your domain. In Route 53, paste the full name. - Click Verify. Most providers propagate within minutes; some take up to 72 hours. Stack Emails also re-checks pending domains automatically every 10 minutes.
Common mistakes
- Two SPF records. Merge them; receivers treat duplicates as a permanent error.
- Proxying DKIM CNAMEs through a CDN. They must resolve directly.
- Doubling the domain — entering
abc._domainkey.acme.comin a panel that appends.acme.comproducesabc._domainkey.acme.com.acme.com. - Jumping straight to
p=rejectbefore checking reports, which can block your own invoices sent from another tool.
How to check your records
From a terminal:
dig +short TXT _dmarc.acme.com
dig +short CNAME abc123._domainkey.acme.com
Or send yourself a test email in Gmail and choose Show original — you should see SPF: PASS, DKIM: PASS and DMARC: PASS.
With all three passing and aligned you have done the single most important thing for deliverability.
Enjoyed this article?
See more from Stack Emails in Google Search.