SPF Record Generator

Generate SPF (Sender Policy Framework) DNS records to prevent email spoofing and improve deliverability. Configure IP addresses, mail servers, and policies instantly.

The domain you want to protect (e.g., yourdomain.com)

SPF Mechanisms

Select which mechanisms to include in your SPF record

Default Policy (all)

What to do when email comes from unauthorized sources

About SPF Record Generator

SPF (Sender Policy Framework) is an email authentication method that helps prevent sender address forgery. By publishing an SPF record in your DNS, you tell receiving mail servers which IP addresses are authorized to send email on behalf of your domain. This reduces the chance of your emails being marked as spam and protects your domain from spoofing and phishing attacks.

Features

  • Support for all SPF mechanisms: a, mx, ip4, ip6, include, redirect
  • Multiple IP addresses and CIDR ranges per mechanism
  • Built-in SPF syntax validation and length warnings
  • Pre-configured includes for popular email services (Google, Microsoft, Mailgun, etc.)
  • One-click copy to clipboard for easy DNS configuration
  • 100% client-side — your domain data never leaves the browser

Frequently Asked Questions

What is an SPF record?

An SPF (Sender Policy Framework) record is a type of DNS TXT record that specifies which mail servers are authorized to send email on behalf of your domain. When a receiving mail server gets an email claiming to be from your domain, it checks your SPF record to verify the sending IP is authorized.

Should I use -all or ~all?

~all (soft fail) is recommended for most users. It tells receivers to accept emails from unauthorized sources but mark them suspicious. -all (hard fail) is stricter and tells receivers to reject unauthorized emails, but it can cause legitimate emails to be rejected if your SPF record is incomplete.

How do I add an SPF record to my DNS?

Log into your DNS provider (e.g., Cloudflare, GoDaddy, Namecheap), find the DNS management section, and add a TXT record with the host/name set to @ or your domain, and the value set to the generated SPF record. Changes may take a few minutes to propagate.

Can I have multiple SPF records?

No, you should only have one SPF record per domain. If you need to authorize multiple services, combine them into a single record using multiple include mechanisms or ip4/ip6 entries. Having multiple SPF records can cause email delivery issues.

What is the 255-character limit?

A single DNS TXT string should not exceed 255 characters. If your SPF record is longer, you can split it into multiple quoted strings (which this generator does automatically) or use include mechanisms to reference other SPF records.