SPF, DKIM and DMARC explained: email authentication in plain language

Updated

SPF, DKIM and DMARC are three DNS records that together decide whether someone else can send email that looks like it comes from your domain. SPF says which servers may send, DKIM signs each message, and DMARC tells receivers what to do when a message fails — and reports back to you.

SPF: which servers may send

An SPF record is a TXT record on your domain listing the servers and services allowed to send mail for it, for example v=spf1 include:spf.protection.outlook.com -all. Receivers check the connecting server against the list.

Two things to know: SPF checks the envelope sender, not the From address people see, and an SPF record may trigger at most ten DNS lookups — beyond that it fails to evaluate. Ending with -all (fail) is stricter than ~all (soft fail).

DKIM: a signature on every message

DKIM adds a cryptographic signature to outgoing mail. The public key is published in DNS under a selector, and receivers use it to verify that the message was signed by your domain and not altered on the way. In Microsoft 365, DKIM is enabled per domain and uses two selector records, so keys can be rotated.

DMARC: what to do when checks fail

DMARC ties the two together with the From address. A message passes DMARC when SPF or DKIM passes and the domain it passed for aligns with the From domain. The DMARC record, a TXT record at _dmarc.yourdomain, then tells receivers what to do with mail that fails:

  • p=none — deliver as normal, but report. A monitoring stage, not protection.
  • p=quarantine — treat failing mail as suspicious, typically delivering it to junk.
  • p=reject — refuse failing mail outright.

A sensible path to protection

  • Publish SPF covering every service that legitimately sends for the domain, within the ten-lookup limit.
  • Enable DKIM for every sending service, including Microsoft 365.
  • Start DMARC at p=none with a rua address, and read the aggregate reports to find legitimate senders you missed.
  • Move to p=quarantine and then p=reject once legitimate mail passes.
  • Do not forget domains that never send mail: give them SPF v=spf1 -all and DMARC p=reject, so they cannot be used for spoofing either.

Where Monokel fits

Monokel observes the external exposure of your domains — DNS, TLS and email authentication — and reads it together with the rest of the environment, so a domain without enforcement is seen in the context of the mail and identities that depend on it.