What is an SPF record generator?
An SPF record generator turns your list of authorized outbound email services and servers into a Sender Policy Framework TXT value. This SPF record builder helps you compose and review that value; the Bulk SPF Checker inspects policies already published in DNS across multiple domains. Neither tool publishes changes or sends email.
SPF evaluates the SMTP MAIL FROM identity, or the HELO identity in relevant cases. That identity can differ from the visible From address. Passing SPF alone does not establish DMARC alignment, DKIM signatures, inbox placement or protection against every kind of spoofing.
Preparing a DMARC policy change? Use the DMARC Record Generator to configure reporting and alignment, compare an imported draft and copy one reviewed TXT value.
How to create an SPF record
- Inventory every legitimate outbound sender: employee mail, support systems, newsletters, transactional mail and servers. Your MX records describe incoming mail and do not identify every outbound service.
- Optionally enter the exact sending domain. Add providers whose setup applies to that domain, then add authorized IPv4/IPv6 addresses or ranges. Account-specific services must use the values assigned in their dashboards.
- Review the ordered terms and ending policy. The initial
~allis a starting choice, not a recommendation for every deployment. Add only senders you intend to authorize. - Fix syntax errors and review warnings. Explicitly run live dependency analysis for literal includes and redirects; macros and sender-specific tests remain unresolved.
- Copy one TXT value, review it against your existing SPF, and apply it in your authoritative DNS manager. Check the published record and test legitimate sending streams afterwards.
SPF record examples for common sending setups
These examples illustrate syntax. They do not verify that your accounts, envelope domains or all sending sources are configured correctly. The documentation IP ranges below are examples, not addresses to authorize in production.
Google Workspace SPF example
v=spf1 include:_spf.google.com ~allThis includes Google's Workspace sending policy. Add other services only after checking their outbound identity and setup instructions. See Google’s official SPF setup.
Microsoft 365 SPF example
v=spf1 include:spf.protection.outlook.com -allThis example applies to worldwide and GCC tenants when Microsoft 365 is the only sending service. GCC High/DoD and 21Vianet use other includes. Select the matching preset and follow Microsoft’s cloud-specific guidance.
Multiple providers and an authorized server IP
v=spf1 include:_spf.google.com include:mail.zendesk.com ip4:203.0.113.10 ~allKeep one version tag and one intended ending policy. Do not paste several complete SPF values together. An IPv6 sender uses ip6:2001:db8::10; ranges use a validated prefix, such as ip4:192.0.2.0/24. Broader ranges authorize more addresses and deserve careful review.
Understanding SPF mechanisms and modifiers
ip4 and ip6 compare a connecting address to a network without DNS lookups. include recursively checks a provider policy and matches only when that policy returns pass. It is not a text substitution. a checks addresses, mx checks mail-exchanger addresses, and exists tests for an A record at its expanded domain-spec.
redirect= delegates the final result when preceding mechanisms do not match. An all anywhere in the record disables redirect. To build a redirect policy, explicitly select “No all” first. The exp= modifier supplies explanation text for a fail result; this tool preserves it but does not retrieve or expand explanations. Imported ptr is recognized, although RFC 7208 discourages publishing it.
Qualifiers control the result when a mechanism matches: + pass, - fail, ~ softfail and ? neutral. Mechanism order can change the result. Terms after all are unreachable, even when their syntax is valid. SPF macros can depend on sender identity and connection context; local validation preserves them without pretending to evaluate them.
SPF softfail vs hardfail
~all means remaining senders are probably unauthorized; receivers decide how to handle softfail. -all declares them unauthorized, so use it after understanding every legitimate sending source. ?all expresses neutral. Advanced +all passes every sender that reaches it and usually defeats the intended restriction. Changing an ending can affect real mail and should follow an inventory and controlled testing.
SPF DNS lookup limits: terms, paths and uncertainty
RFC 7208 limits evaluation to ten reached DNS-query-causing terms: include, a, mx, ptr, exists and redirect. Nested evaluations share that budget. ip4, ip6, all and the later explanation lookup are not those terms. A count in the draft is only a starting point.
Live analysis follows literal include/redirect records and models possible outcomes with short-circuiting. It does not add every branch as if all must execute. A bound of 11 or more indicates potential risk, not proof that every sender fails. Address matches, macros, void lookups, MX/PTR expansion and correlations between branches require an actual sender context. No result here certifies full compliance or proves a sender-specific permerror. Read how to investigate SPF lookup-limit risks.
How to modify an existing SPF record safely
Paste the value, or fetch the domain's published TXT records and inspect the snapshot before clicking “Replace draft.” A multi-string TXT answer is reconstructed within that one resource record. Multiple separate SPF records are shown as an error to investigate; they are never merged automatically.
Supported terms keep their qualifiers, domain-specs, CIDR lengths and order. Extension or unrepresentable syntax stays in the advanced editor rather than disappearing. The comparison shows added/removed terms, qualifier changes, ending, redirect and newly introduced findings. Moving or removing terms is explicit, with Undo and a revert-to-import action. Review every removed sender; a text diff cannot guarantee unchanged email delivery.
How to publish SPF as a DNS TXT record
Use type TXT, the exact envelope sending domain, your generated value and your provider's default TTL unless you have a reason to choose another. At the zone apex, providers vary: @, a blank host or the full domain may be required. A subdomain may require a relative name within the zone. Do not blindly add the domain twice.
A TXT character-string is limited to 255 octets, but one TXT resource record may contain several strings concatenated without inserted spaces. The builder shows a zone-file representation with valid string sizes. Many control panels handle splitting themselves. Several strings in one record are different from multiple independent SPF records, which are invalid at the same name. Long TXT responses also raise DNS size and compatibility concerns; splitting is not a lookup-limit fix.
Common SPF configuration mistakes
- Adding a second SPF TXT policy instead of deliberately updating the existing one.
- Authorizing a service on the root domain when it sends with a separate return-path subdomain.
- Guessing a generic include for a provider that assigns CNAME or account-specific values.
- Removing a legitimate sender merely to reduce a static term count.
- Flattening dynamic provider ranges without maintaining their future changes.
- Combining
allwith an intended redirect, publishing+allunintentionally, or treating a DNS timeout as proof of a missing record.
SPF vs DKIM vs DMARC
SPF checks the connecting server against an envelope-domain policy. DKIM signs message content using a domain's keys. DMARC relates passing SPF or DKIM authentication to the visible From domain through alignment and publishes handling/reporting preferences. Use the Bulk DMARC Checker for DNS policy inspection, then evaluate real messages' authentication results. DNS configuration alone does not guarantee deliverability.
Frequently asked questions
Can I generate SPF offline?
After the page and its scripts load, generation, pasted import, editing, syntax review, comparison and export use local computation. Published import and optional dependency analysis need network access. This is not an installable offline cache; revisiting an uncached page still needs access.
Does selecting a provider authorize my account?
No. Presets are documented setup aids. Confirm the provider's sending domain, tenant, product and authentication steps. Guided entries deliberately do not insert a guessed include. Official links and the review date appear in the builder.
Can I combine SPF records from several providers?
Combine the necessary mechanisms into one deliberate policy, retaining all legitimate sources and reviewing order, ending and lookup risks. Do not concatenate independent complete records or automatically merge multiple published SPF policies.
Why is a macro or custom modifier kept in advanced mode?
The tool preserves syntax it cannot safely map to its visual controls. Supported macros remain editable within domain-specs; unknown extension modifiers are retained and ignored by SPF as specified. Syntax errors remain visible and block export rather than being silently repaired.
Are drafts saved or published?
No. Drafts and DNS results stay in page memory and are lost when you leave. Copy or download your work. No draft is attached to Analytics, placed in the URL or stored by default. Explicit live actions disclose query names and connection metadata to your selected public resolver; see privacy details.
Technical references
The shared parser and conservative dependency analysis follow RFC 7208 (especially sections 3–7 and 12). Current RFC status and updates and errata were reviewed on October 28, 2026. Provider presets link to their own official documentation and should be rechecked when those services change.