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.
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:
~allmarks other senders as suspicious;-allsays they fail.
Set it up
- List every service that sends email with your domain in the From address: your mailbox provider, newsletter tool, CRM, website forms, invoicing.
- Find each one's SPF
include:in its help pages. - 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. - 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.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.