SPF, DKIM and DMARC explained: a practical guide

18 November 2026 · 8 min read

Gmail, Yahoo and Outlook decide whether to trust an email largely from three DNS records: SPF, DKIM and DMARC. Since 2024, Gmail and Yahoo require them from anyone sending in volume, and mail without them is far more likely to land in spam. Here's what each one does, how to check yours, and the mistakes that break them.

SPF: which servers may send for your domain

SPF (Sender Policy Framework) is a TXT record listing the servers allowed to send mail for a domain:

text
v=spf1 include:_spf.google.com include:_spf.trivsend.com ~all

The receiving server looks at the envelope sender (the Return-Path, where bounces go), not the From address you see, and checks whether the sending IP is on that domain's list.

Common mistakes:

Many email services, TrivSend included, use their own return-path subdomain (for example bounces.notify.yoursite.com) with its own SPF record, so your main SPF record doesn't change at all.

DKIM: a signature on every email

DKIM (DomainKeys Identified Mail) adds a cryptographic signature to each email. The sending service keeps a private key; you publish the matching public key as a TXT record:

text
trivsend._domainkey.notify.yoursite.com  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."

The receiver fetches the key and checks the signature. A valid DKIM signature proves the email came from someone holding your key, and that it wasn't changed on the way.

Common mistakes:

DMARC: what to do when checks fail, and reports

DMARC ties it together. It says: "an email using my domain in From must pass SPF or DKIM for this same domain; here's what to do if it doesn't, and where to send reports."

text
_dmarc.yoursite.com  TXT  "v=DMARC1; p=none; rua=mailto:dmarc-reports@yoursite.com"

Receivers send daily aggregate reports to the rua address, listing every IP that sent mail as your domain and whether it passed. Read them for a couple of weeks, make sure every legitimate sender passes, then tighten to quarantine and later reject. That stops others from sending email that pretends to be you.

How to check your records

From a terminal:

bash
dig TXT yoursite.com +short                          # SPF on your main domain
dig TXT trivsend._domainkey.notify.yoursite.com +short   # a DKIM key
dig TXT _dmarc.yoursite.com +short                   # DMARC

Or send a test to a tool like mail-tester.com, which shows SPF, DKIM and DMARC results for a real message. In TrivSend, the domain page checks each record and shows which are missing.

Summary

RecordAnswersWhere
SPFIs this server allowed to send for the domain?TXT on the return-path domain
DKIMWas this email signed by the domain, and unchanged?TXT at selector._domainkey
DMARCDo SPF/DKIM match the From domain, and what happens if not?TXT at _dmarc

All three together are what mailbox providers now expect.

TrivSend sets up all three for your sending domain, adds them for you at Cloudflare, and collects your DMARC reports. Start free.