SPF Record Generator — Build TXT SPF Policies
Assemble v=spf1 TXT records with includes, IPv4, mx, a, and fail policy entirely in your browser
How to Use This Tool
- Enter the domain context for your SPF policy (for reference in your workflow).
- Add include: targets for third-party senders such as Google Workspace or Mailchimp.
- List IPv4 addresses or CIDR ranges authorized to send directly.
- Toggle mx and a if your mail originates from the domain's MX or A targets.
- Select -all (hard fail), ~all (soft fail), or ?all (neutral) qualifier.
- Copy the generated v=spf1 string into your DNS TXT record at the apex.
About This Tool
Sender Policy Framework (SPF) publishes which hosts may send mail claiming your domain in the envelope From address. A malformed SPF string breaks delivery; an overly permissive policy invites spoofing. VSPIC SPF record generator runs entirely client-side — you add include domains, IPv4 addresses, toggle mx and a mechanisms, choose -all, ~all, or ?all policy, and receive a copy-ready v=spf1 TXT record without server round trips.
The builder concatenates mechanisms in standard order: v=spf1, optional a and mx, ip4 entries, include entries, then your selected all qualifier. Nothing is uploaded to our servers — suitable for drafting records before pasting into DNS panels, ticketing systems, or change windows. Pair output with our SPF/DKIM/DMARC checker after publishing to confirm live DNS matches intent.
Common use cases
- •View all DNS records of a domain after migration
- •Confirm DNS records after domain changes
- •Test for DNS leaks when using a VPN
- •Debug email delivery with MX and TXT records
Why use VSPIC for ?
- Client-side generation — SPF draft never leaves your browser.
- Supports include, ip4, mx, and a in one builder.
- Explicit -all, ~all, and ?all policy selection.
- Copy-ready single-line TXT suitable for DNS panels.
- Reduces syntax errors from manual v=spf1 assembly.
- Free utility with no account or API quota.
SPF basics for domain owners
SPF is a TXT record at the domain apex (and sometimes per-subdomain) starting with v=spf1 followed by mechanisms describing authorized senders. Receivers evaluate SPF during SMTP, expanding includes recursively up to DNS lookup limits. A final all mechanism declares default handling for everyone not matched — -all means fail, ~all means soft fail, ?all means neutral.
Our generator focuses on the most common production mechanisms: a, mx, ip4, include, and all. That covers typical small-business Google/Microsoft hosting plus one ESP include without learning RFC syntax by heart.
Choosing include targets
Each include:domain pulls in another domain's SPF policy recursively. SaaS email vendors publish exact include hostnames — paste those strings without the include: prefix; the builder adds it. Stacking multiple includes for CRM, newsletter, and ticketing tools is normal; watch total DNS lookup depth.
Never guess includes from memory. Vendor documentation changes when they migrate infrastructure. After generating, publish to a low-TTL staging subdomain first when your architecture supports test zones.
ip4, mx, and a mechanisms
ip4 entries authorize specific IPv4 addresses or CIDR ranges — common for on-premise appliances with static egress. mx authorizes the A records of your domain's MX hosts. a authorizes the domain's own A record. Toggle mx and a only when mail actually sends from those paths to avoid widening the policy unnecessarily.
The builder emits ip4: entries one per line you supply. CIDR notation depends on your DNS host supporting it in SPF — most do for /32 through reasonable prefixes.
Hard fail, soft fail, and neutral policy
-all is the recommended production default once you confirm all legitimate senders are listed. Receivers should reject or strongly filter mail failing SPF. ~all marks failures as soft fail — still deliverable to spam — useful during migration before you commit to -all.
?all is neutral and offers minimal anti-spoofing value. Use it only during initial monitoring, not as a long-term posture. Our email spoofing test flags permissive all qualifiers as risk factors.
Client-side privacy advantage
SPF drafting reveals your mail vendor choices and infrastructure IPs. Client-side generation keeps that inventory on your machine — no upload to our API, no logging of includes or ip4 lists. Suitable for regulated environments drafting records before change approval.
Copy the output into password-protected change tickets rather than public pastebins when lists contain sensitive egress IPs.
Publishing TXT at the DNS host
SPF lives in a single TXT record at the apex unless subdomains publish separate mail streams. Some hosts want quotes around the string; others accept the raw line. Only one SPF TXT per label — merging two v=spf1 strings invalidates both.
After publish, wait for TTL propagation and verify with our SPF/DKIM/DMARC checker or email deliverability checker. Automated tests catch typos like v=spf1 missing or double spaces breaking parsers.
SPF lookup limit and flattening traps
Receivers allow at most ten DNS lookups while evaluating SPF, counting includes and certain mechanisms. Deep include chains cause PermError and SPF failure even when policy intent is correct. Our generator does not count lookups — manually audit includes or use dedicated SPF flattening services if you approach the limit.
Flattening replaces includes with ip4 lists — high maintenance when ESP IPs rotate. Prefer subdomain delegation for large marketing streams when possible.
Relationship to DMARC and DKIM
SPF alone does not stop header From spoofing — DMARC adds domain-level policy aligned with SPF and/or DKIM. Generate SPF here, DKIM keys at your mail host, then use our DMARC record generator for _dmarc TXT policy.
Alignment matters: DMARC may require relaxed or strict SPF alignment between envelope and header domains. Document both when onboarding new senders.
Common mistakes to avoid
Publishing multiple SPF TXT records, omitting v=spf1, using ptr mechanism (deprecated), or leaving +all implicit through misconfigured includes. Another frequent error is authorizing overly broad ip4 /8 ranges — attackers on the same ISP block could qualify.
Regenerate after every mail vendor migration. Stale includes to decommissioned ESP infrastructure cause legitimate mail to fail SPF after vendors retire old redirect domains.
When not to use this generator alone
Complex enterprise deployments with ip6, redirect=, exists:, or macro-heavy policies need manual RFC 7208 authoring or vendor wizards. This tool targets straightforward SMB and agency stacks.
Always validate live DNS after publish — generation correctness does not replace propagation checks.
Important notes & limitations
- Does not publish DNS — you must add TXT at your host manually.
- No ip6, ptr, exists, or redirect mechanisms in the builder.
- Does not enforce the ten-DNS-lookup SPF evaluation limit.
- Cannot detect duplicate or conflicting existing SPF TXT.
- Provider-specific include strings must be sourced from vendor docs.
Frequently Asked Questions
Yes. VSPIC offers this SPF record generator at no cost with no account required. Results load in real time.
We do not permanently store your queries on our servers. Some tools run entirely in your browser; others fetch public data for the request only.
Yes. Open the page in any modern phone or tablet browser. Results work on Wi‑Fi and mobile data.
No. Record assembly runs entirely in your browser. Copy the output into your DNS provider yourself.
Use ~all during testing, then -all for production once all senders are authorized. ?all provides weak protection and is not recommended long term.
Yes. Enter each include hostname on its own line. The builder prefixes each with include: automatically.
Not in this builder. Add ip6 mechanisms manually to the output if your mail sends over IPv6.
As a TXT record at your domain apex (example.com) unless your mail uses a dedicated subdomain policy.
Use our SPF/DKIM/DMARC checker or email deliverability checker to confirm live DNS matches your generated string.
Next step for your check
Continue with spf dkim dmarc checker on VSPIC.
Related Tools
Explore more free VSPIC tools for IP, DNS, security, and network diagnostics.
SPF DKIM DMARC Checker
Validate email authentication DNS records for any domain
Use Free →DMARC Record Generator
Generate DMARC TXT for _dmarc with policy, rua, and alignment tags
Use Free →Email Deliverability Checker
Analyze SPF, DKIM, DMARC, MX, and deliverability score
Use Free →TXT Record Lookup
Read TXT records — SPF, DKIM, DMARC, and verification strings
Use Free →DNS Lookup Tool — DNS Checker
Free DNS lookup tool and DNS checker — query A, AAAA, MX, TXT, NS, CNAME, and SOA records for any domain.
Use Free →Reverse DNS Lookup
Resolve IP addresses to hostnames via PTR records
Use Free →
Trusted by Users Who Value Privacy
Always Free
No premium plan ever
100% Private
Files processed in browser
Instant Results
Convert in seconds
Works Everywhere
Any device, any OS