Security fundamentals

What are SPF, DKIM, and DMARC?

In short

SPF, DKIM, and DMARC are three published DNS records that together let receiving mail servers check whether a message claiming to come from your domain is genuine, and tell them what to do when it is not.

Definition

SPF, DKIM, and DMARC are complementary email-authentication mechanisms published as DNS records: SPF lists which servers may send mail for a domain, DKIM cryptographically signs outgoing messages, and DMARC tells receivers what to do with mail that fails those checks and where to send reports.

Background

Email was designed without a way to verify the sender, so anyone can put your domain in the From line. The three records close that gap from different angles. SPF (RFC 7208) is a TXT record listing the servers and services authorized to send as your domain. DKIM (RFC 6376) attaches a signature to each outgoing message that a receiver verifies against a public key in your DNS, proving the message was not altered in transit and did come from an authorized sender. DMARC (RFC 7489) ties the two together: it requires that a passing SPF or DKIM result also aligns with the domain in the visible From address, states a policy for handling failures, and asks receivers to send aggregate reports back to an address you nominate.

Why it matters

Domain spoofing is the mechanism behind a large share of phishing and business email compromise, and the target is often your customers and suppliers rather than your own staff. These records are also public, which cuts both ways: a prospect, an auditor, or an attacker can check your DMARC policy in seconds and see whether you enforce it or merely watch. Because they are cheap to publish and externally visible, they are a common early signal of how seriously an organization takes security — and several frameworks expect email protections of this kind as part of communications security.

Step by step

  1. Inventory every service that sends mail as your domain, including marketing, invoicing, ticketing, and product notifications.
  2. Publish an SPF record covering exactly those senders, and keep it within the lookup limits the specification sets.
  3. Enable DKIM signing at each sending service and publish the corresponding public keys.
  4. Publish DMARC starting at p=none with a reporting address, so you can see who is sending as you before you enforce anything.
  5. Read the aggregate reports, fix the legitimate senders that fail alignment, then move the policy to quarantine and finally to reject.
  6. Re-check whenever you add a mail-sending vendor, because a new sender that nobody added to SPF starts failing silently.

Examples

  • A company at p=none discovers from its reports that an invoicing tool has been sending unaligned mail for a year, fixes it, and then moves to p=reject.
  • An attacker sends invoice fraud from a lookalike sender; because the real domain publishes p=reject, the spoofed variant is refused rather than delivered.

Common mistakes

  • Publishing DMARC at p=none and treating that as done. Monitoring is not enforcement, and a policy of none instructs receivers to do nothing.
  • Going straight to p=reject without reading reports first, which silently blocks legitimate mail from a sender nobody remembered.
  • Letting SPF drift as vendors are added and removed, until it exceeds its lookup limit or authorizes services no longer in use.
  • Assuming DKIM alone is enough; without DMARC, a receiver has no instruction about what to do when a check fails.

FAQ

Which one should we set up first?

SPF and DKIM first, because DMARC evaluates their results. Then publish DMARC at p=none to collect reports, and only tighten the policy once the reports show your legitimate senders passing.

What does p=none actually do?

Nothing to the mail. It asks receivers to deliver as they normally would and send you aggregate reports. It is the right starting point and the wrong resting point.

Can anyone see our email authentication setup?

Yes. All three are public DNS records, so anyone can query them without touching your systems. That is how external assessments and free posture checks read them.

Next step

Do this in Keel, not a spreadsheet

Keel is the AI-native GRC platform for SMBs: one control-and-evidence graph across SOC 2, ISO 27001, HIPAA, PCI DSS, NIST CSF, and more. Start free, no credit card.