SPF Record Generator
Build a valid SPF TXT record by ticking the email providers you use. Counts DNS lookups so you stay within the RFC 7208 limit of 10.
By Deepak Shukla — Founder & CEO, Pearl Lemon
Build your SPF record
v=spf1 include:_spf.google.com ~all
Publish as a TXT record on the apex of your sending domain. Name: @ · Type: TXT · Value: the string above.
What This Tool Checks
- Pre-built includes for Google Workspace, Microsoft 365, Mailgun, SendGrid, Mailchimp, Postmark, Amazon SES, Zoho, Resend
- Custom IPv4 and IPv6 ranges
- Optional `a` and `mx` mechanisms
- Live DNS lookup counter against the RFC 7208 limit of 10
- Strictness terminator (-all, ~all, ?all) with explanations
- Free-form additional includes for niche senders
Why This Matters
Without SPF, anyone can forge mail from your domain — phishing campaigns, spoofed invoices, fake password resets, the lot. Gmail, Outlook, and Yahoo now silently drop a growing share of unauthenticated mail. A correct SPF record is the cheapest deliverability fix available and the foundation DMARC sits on.
How to Fix Issues
- 1.List every service that sends mail from your domain (transactional, marketing, helpdesk, ATS, ESP)
- 2.Tick each one in the generator — the include strings are pre-filled
- 3.Add any custom IP ranges your servers send from directly
- 4.Start with `~all` (soft-fail) while you check reports, then promote to `-all`
- 5.Publish as a TXT record on the apex of your domain (Name: @, Type: TXT, Value: the generated string)
- 6.Wait 24 hours, then verify with a DMARC report or our deliverability checker
An SPF record is one line of DNS that lists every server allowed to send email using your domain. It is simple to write and easy to break, and a broken one fails silently — nothing errors, your mail just performs worse. This generator assembles a valid record from the services you actually use and counts the lookups as you go.
The ten-lookup limit is the whole difficulty
Evaluating an SPF record may trigger at most ten DNS lookups. Every include, a, mx and redirect mechanism costs at least one, and provider includes nest inside each other, so a single large platform can consume several. Add a marketing tool, a CRM, a helpdesk and a transactional sender over a few years and you pass ten without noticing. Past the limit the record does not degrade — it fails, and every message you send is treated as unauthenticated. The counter here exists because this is the failure that catches experienced teams.
Choosing the terminator
The last mechanism decides what a receiving server should do with mail from a server not on your list. A soft fail marks it as suspicious but generally accepts it, which is the right setting while you are still discovering who sends on your behalf. A hard fail instructs the server to reject it, which is where you want to end up once your inventory is complete and DMARC reports are quiet. A neutral terminator states no opinion and is worth almost nothing. Start soft, finish hard, and let reports rather than confidence decide when to move.
One record, not several
A domain must have exactly one TXT record beginning v=spf1. Two is a configuration error, and receiving servers may ignore both, which turns a well-intentioned addition into a total failure. When you add a service, merge its include into the existing record rather than publishing a second one.
What SPF does not cover
SPF authorises servers, not messages. It does not survive forwarding, because the forwarding server is not on your list, and it says nothing about whether the visible From address matches the authenticated domain. That gap is what DKIM and DMARC close, which is why SPF should be treated as the first of three steps rather than the whole job.
Methodology
A deterministic client-side builder following RFC 7208 (the SPF specification). Each provider tick adds an include: mechanism using that provider's officially documented SPF host — pulled from each vendor's setup docs as of June 2026 and reviewed quarterly. We count DNS lookups in real time: include, a, mx, ptr, and exists each consume one of your ten allowed lookups; ip4 and ip6 do not. The lookup counter warns you above 8 and errors above 10. The strictness terminator (-all, ~all, ?all) sits at the end of the record per spec, and the entire record is rendered as a single space-separated string ready to paste into your DNS provider as a TXT value on the apex.
Frequently Asked Questions
Related Free Tools
DMARC Generator
Build a valid DMARC TXT record in under a minute. Choose your policy, set reporting addresses, and get a copy-paste record to publish at _dmarc.
Email Deliverability
One-click audit of MX, SPF, DMARC, MTA-STS, and BIMI for any domain. Identifies the exact reason your mail is hitting spam — and what to fix first.
DNS Lookup
View all DNS records for any domain — A, AAAA, CNAME, MX, TXT, NS records. Verify DNS configuration instantly.
HTTP Status Code Reference
Understanding HTTP status codes helps you diagnose issues found by this tool: