webzod
account

Narrow the very large address range in the SPF record on Cloudflare

email.spf.permissive_range · effort: about an hour

Why it matters

The record authorises a huge block of IP addresses to send as your domain, most of which are not yours. Anyone who controls one address in that block can send mail that passes SPF.

Staged change. Do this in stages and check each one before the next, so a mistake does not break your site or your mail.

The fix

  1. In the Cloudflare dashboard open DNS > Records, edit the SPF TXT record and replace the broad ip4 or ip6 term with the exact addresses or small ranges that send your mail.
  2. Save. Check DMARC reports for a few days for legitimate senders that now fail.
text
Type:     TXT
Name:     example.com
Content:  v=spf1 ip4:203.0.113.25 ip4:198.51.100.0/28 ~all

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.