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.
On this page
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
| SPF | DKIM | DMARC | |
|---|---|---|---|
| Checks | Is 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? |
| How | TXT record listing servers | Signature in each message, public key in DNS | TXT record with a policy |
| Record name | @ | x._domainkey | _dmarc |
| Breaks when | Mail is forwarded | The message is altered | Neither 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
- SPF. How to set up an SPF record
- DKIM, enabled in DirectAdmin. How to enable DKIM in DirectAdmin
- 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?
- Set up SPF, DKIM and DMARC
Intermediate · 30 min
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.
- Understanding email bounce messagesRead an email bounce (non-delivery report): the common 4xx and 5xx codes, what ‘mailbox full’, ‘relay denied’ and ‘rejected by policy’ mean, and what to do.
- Can’t send email: how to fix outgoing mailFix email that won’t send from your app or phone: SMTP authentication, port and encryption mismatches, blocked networks and sending limits.
Spotted something out of date or unclear? Tell us and we’ll fix it.