Tutorial · dns-ssl · Published 2026-08-16 · 4 min read

SPF, DKIM and DMARC records

SPF, DKIM and DMARC explained with real record examples, and how to add them so your email lands in the inbox and not spam.

Flat editorial illustration showing a globe of orbiting nodes resolving into a key and shield form, dotted resolution paths converging.
Illustration: this article at a glance.

The three records

Email authentication is three DNS records doing three jobs. SPF authorises which IP hosts may send like your domain, DKIM signs the message so the receiver can verify it was not altered, and DMARC tells the receiver what to do with mail that fails both. None is optional for deliverability: receivers increasingly reject mail that does not carry all three.

Editorial close-up illustration showing a globe of orbiting nodes resolving into a key and shield form, dotted resolution paths converging.
Illustration: a closer look at the technique described above.
RecordJobFailure looks like
SPFList of allowed senders (v=spf1 ... -all)Mail passes auth but receiver sees a soft/hard fail
DKIMA public key the receiver checks against the signed headerdkim=fail in a header analyzer
DMARCPolicy (none, quarantine, reject) + reportingAn auth not aligned quarantine

SPF

example.com. TXT "v=spf1 include:_spf.provider.example.com ~all"

The string is a chain of mechanisms. include: pulls in the listed domain's record (a provider publishes its own), and the terminal ~all or -all says what to do with everyone else: ~all soft-fail, -all hard-fail. A hard-fail with an incomplete allow-list silently breaks email from a host you forgot to include.

Hard limits to respect:

DKIM

DKIM is a TXT record at a selector from the mail provider: often default, google, or s1, named like s1._domainkey. The mail server looks up that record when it verifies a signed message.

default._domainkey. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0...base64-key"

DMARC

_dmarc.example.com. TXT "v=DMARC1; p=none; rua=mailto:[email protected]; pct=100"

The p= policy is a progression. Start at p=none to watch reports, move to p=quarantine when you confirm mail passes, then p=reject once you trust the list. Common failure modes:

Deploy order

  1. Document your senders. Every service that emails from your domain (host, newsletter, CRM, transactional API) has an allow entry; list them before editing SPF.
  2. Add SPF first with ~all, verify each sender from a fresh mailbox, then tighten to -all.
  3. Add DKIM key from each provider, verify with dkimvalidator or the provider's own test.
  4. Add DMARC at p=none with reports, collect two weeks of rua aggregate XML, confirm pass rates, then move policy up one notch.
  5. Validate with a send from each provider and read the headers with a mail-tester service; check spf=pass, dkim=pass, dmarc=pass.

Common mistakes

When to involve a professional

If the mail upstream is a third party that runs its own helpers (Google Workspace, Microsoft, a B2B CRM) and reports spf=pass while a delivery test still quarantines, the sender requirements and header signer are the expert's territory. Hand them the "who sends this domain's mail" list and let them align the pieces.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services