SPF (Sender Policy Framework) specifies which mail servers are authorized to send email on behalf of your domain. A properly configured SPF record is essential for email deliverability and preventing spoofing.
If your domain has no SPF record, receiving mail servers cannot verify that emails claiming to be from your domain are actually authorized. This makes your domain vulnerable to spoofing and can hurt deliverability.
Add a TXT record to your domain's DNS with your SPF policy. The exact steps depend on your DNS provider:
If you use Google Workspace:
v=spf1 include:_spf.google.com ~allIf you use Microsoft 365:
v=spf1 include:spf.protection.outlook.com ~allIf you use multiple email services (e.g., Google + Mailchimp):
v=spf1 include:_spf.google.com include:servers.mcsv.net ~allinclude: value to use.You can only have one SPF record per domain. If you need to authorize multiple email services, combine them into a single record using multiple include: statements.
v=spf1Before (broken):
v=spf1 include:_spf.google.com ~all
v=spf1 include:sendgrid.net ~allAfter (fixed):
v=spf1 include:_spf.google.com include:sendgrid.net ~all+all allows anyone on the internet to send email as your domain. This is a severe security vulnerability that must be fixed immediately.The +all mechanism tells receiving servers to accept email from any IP address as legitimate mail from your domain. This completely defeats the purpose of SPF.
Replace +all with ~all (soft fail) or -all (hard fail):
Before (dangerous):
v=spf1 include:_spf.google.com +allAfter (secure):
v=spf1 include:_spf.google.com ~all-all — Hard fail: Reject unauthorized senders (most strict)~all — Soft fail: Mark as suspicious but accept (recommended)?all — Neutral: No policy (not recommended)+all — Pass: Accept everyone (never use this)Every SPF record should end with an "all" mechanism that specifies what to do with senders not explicitly listed. Without this, the behavior is undefined and may vary between mail servers.
Add ~all or -all to the end of your SPF record:
Before (incomplete):
v=spf1 include:_spf.google.comAfter (complete):
v=spf1 include:_spf.google.com ~all~all (soft fail) while testing. Once you've confirmed all legitimate mail is passing, consider switching to -all (hard fail) for stricter protection.SPF has a limit of 10 DNS lookups per check. Mechanisms like include:, a, mx, ptr, and exists each count as a lookup. Exceeding this limit causes SPF to fail with a PermError.
ip4: and ip6: do NOT count toward the lookup limit since they don't require DNS queries.include: statements with the actual IP addresses they resolve to. Use tools like SPF Lookup to see what IPs an include resolves to.Example of flattening:
Before (with many lookups):
v=spf1 include:_spf.google.com include:amazonses.com include:sendgrid.net ~allAfter (flattened with IPs):
v=spf1 ip4:209.85.128.0/17 ip4:74.125.0.0/16 include:sendgrid.net ~allA null SPF record (v=spf1 -all) explicitly states that no servers are authorized to send email from your domain. This is intentional when a domain should never send email.
A null SPF is appropriate for:
If your domain does send email (transactional emails, newsletters, etc.), a null SPF will cause all your emails to fail authentication.
Add your email service providers to the SPF record:
Before (null record):
v=spf1 -allAfter (with authorized senders):
v=spf1 include:_spf.google.com ~allAfter making changes, use our checker to confirm everything is configured correctly.