SPF, DKIM and DMARC explained

What SPF, DKIM and DMARC each do, how they work together, and the order to set them up so your email reaches inboxes.

Guide2 min readLast updated
On this page
  1. At a glance
  2. How they work together
  3. Set them up in this order
  4. What they don’t do
  5. If it doesn’t work

Email was designed without any way to prove who sent a message, which is why forged senders are easy. SPF, DKIM and DMARC are three DNS-based checks that fix that. Gmail, Outlook and Yahoo now expect them.

At a glance

SPFDKIMDMARC
ChecksIs this server allowed to send for the domain?Was the message signed by the domain, unchanged?Do SPF/DKIM match the visible From address, and what to do if not?
HowTXT record listing serversSignature in each message, public key in DNSTXT record with a policy
Record name@x._domainkey_dmarc
Breaks whenMail is forwardedThe message is alteredNeither aligned check passes

How they work together

  • SPF alone fails when a message is forwarded, because the forwarding server isn’t in your list.
  • DKIM survives forwarding, because the signature travels with the message.
  • DMARC passes if either SPF or DKIM passes and matches the domain in the From address. It also tells receivers what to do with failures and sends you reports.

Set them up in this order

  1. SPF. How to set up an SPF record
  2. DKIM, enabled in DirectAdmin. How to enable DKIM in DirectAdmin
  3. DMARC, starting with a monitoring policy. How to set up a DMARC record

The email authentication tutorial does all three with checks along the way.

What they don’t do

They don’t guarantee inbox placement. Content, sending reputation and complaint rates still matter. Why are my emails going to spam?

Prefer to follow along?

If it doesn’t work

These guides cover the most common problems, starting with what you can see. Or browse every fix for a common problem.

Spotted something out of date or unclear? Tell us and we’ll fix it.

Keep going