DEV Community

DNSFix.com
DNSFix.com

Posted on Originally published at dnsfix.com

How to set up SPF (and fix "SPF record not found")

Short answer: SPF is one TXT record on your domain that lists every service allowed to send email as you.

Three rules

  • Exactly one SPF record. Two make SPF fail (RFC 7208).
  • At most 10 DNS lookups inside it. More than 10 makes SPF fail.
  • The ending: ~all marks other senders as suspicious; -all says they fail.

Set it up

  1. List every service that sends email with your domain in the From address: your mailbox provider, newsletter tool, CRM, website forms, invoicing.
  2. Find each one's SPF include: in its help pages.
  3. Create one TXT record at the root of your domain (host @) with all the includes, ending in ~all. If you already have an SPF record, edit it. Never add a second one.
  4. Check it again. Count your lookups: they must stay at 10 or fewer.

What it looks like

v=spf1 include:_spf.example-mail.com include:servers.example-newsletter.net ~all

That says: my mailbox service and my newsletter tool may send as this domain; treat anything else as suspicious.

~all or -all?

Start with ~all. Once DMARC is at reject, ~all is fine because DMARC does the enforcing, and -all can break forwarded mail.


First published on DNSFix. Check your own domain free at dnsfix.com.

Top comments (0)