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:
v=spf1 include:_spf.google.com include:_spf.trivsend.com ~allThe 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:
- Two SPF records on the same name. Only one is allowed; with two, SPF fails for everything. Merge them into one record.
- More than 10 DNS lookups. Every
include:,a,mxandredirectcounts, including the ones inside includes. Past 10, SPF fails with a "permerror". - Ending with
+all. That allows the whole internet to send as you. Use~all(soft fail) or-all(fail).
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:
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:
- A truncated key. The value is long; copy it exactly, without line breaks or missing characters.
- The wrong name. The selector (
trivsendabove) and._domainkey.are part of the name. Some DNS panels add your domain automatically, so you type onlytrivsend._domainkey.notify.
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."
_dmarc.yoursite.com TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@yoursite.com"p=none: just report. Start here.p=quarantine: failing mail goes to spam.p=reject: failing mail is refused.
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:
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 # DMARCOr 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
| Record | Answers | Where |
|---|---|---|
| SPF | Is this server allowed to send for the domain? | TXT on the return-path domain |
| DKIM | Was this email signed by the domain, and unchanged? | TXT at selector._domainkey |
| DMARC | Do 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.