SPF RECORD GENERATOR

SPF Record Generator.
Build the policy. Keep your senders.

Create one SPF TXT record from your email providers and sending IPs. Import an existing policy without losing its order, review changes and copy the settings for your DNS manager.

BUILD · REVIEW · COPY

Build one SPF TXT record

Local generation and syntax checks work without DNS access. Nothing is published automatically.

In your browser

Use the SMTP envelope domain. Providers are never inferred from MX records.

Email providers

Add only services you use for outbound mail from this domain. A preset does not verify your account setup.

For mail sent through Google Workspace. Add other outbound services separately.

Official setup instructions · reviewed October 28, 2026

Ordered SPF terms

Evaluation order matters. Existing terms stay in place until you edit, move or remove them.

    Add a custom term

    ip4/ip6 require an address. include/exists/redirect/exp require a domain-spec. a/mx/ptr can omit it to use the evaluated domain. SPF macros are preserved, not expanded here.

    ~all is a starting choice, not universal deployment advice. Use -all only after accounting for legitimate senders. No all permits redirect or the neutral default.

    Advanced editor and +all policy

    Use +all only if you intend to authorize every sender that reaches it. Advanced edits preserve the full value, including extension modifiers and macros. Applying changes replaces the current draft.

    Import an existing SPF record

    Changing SPF can affect legitimate mail. Review all authorized senders before replacing a record. Importing changes only this page.


    Fetch uses the sending domain above. DNS queries go from your browser to the chosen resolver, not a DNSBatch backend.

    YOUR DNS TXT VALUE

    Generated SPF record

    v=spf1 ~all

    Validation and lookup risks

      Mechanism breakdown

        Syntax and configuration inspection do not prove that any specific sender passes SPF. No sender-specific evaluation or void count is performed.

        Live DNS analysis has not been run.

        Live analysis sends literal include/redirect names to your selected resolver. Five slots, 50ms pacing, eight-second timeouts; at most 200 requests, 10 dependency levels and 80 nodes. Macros and address-based tests remain indeterminate.

        Publish in your DNS manager

        Type
        TXT
        Name / Host
        Your sending domain
        Value
        The SPF value above
        TTL
        Your DNS provider’s default

        At the zone apex, some providers use @, others a blank field or the full domain. Subdomain labels depend on the zone you are editing. Follow your DNS provider’s instructions.

        TXT character-string representation

        Each string is at most 255 octets. These strings belong to ONE TXT resource record and concatenate without extra spaces. Many DNS panels split automatically; do not create independent SPF records or paste zone-file quotes unless instructed.

        After publishing, use the Bulk SPF Checker to inspect the record in DNS.

        Edit an existing SPF record without dropping a sending service

        Import the current policy, inventory approved senders and review the ordered changes before copying a replacement. Generating a draft does not publish it.

        Illustrative examples only. These are not live DNS results or settings to copy.
        SituationExample evidenceNext step
        Existing senderv=spf1 include:senders.example.net ~allPreserve the approved include when adding another service. The example hostname is not a provider configuration.
        New serviceThe service supplies an additional include or IP rangeVerify the provider’s assigned value, add it to the same policy and inspect dependency risks.
        Ready for reviewA single edited TXT draft with an explicit ending policyCopy the draft and compare it with the original; follow the provider’s publishing procedure and recheck DNS.

        Import and modify an existing SPF policy →

        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

        1. 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.
        2. 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.
        3. Review the ordered terms and ending policy. The initial ~all is a starting choice, not a recommendation for every deployment. Add only senders you intend to authorize.
        4. Fix syntax errors and review warnings. Explicitly run live dependency analysis for literal includes and redirects; macros and sender-specific tests remain unresolved.
        5. 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 ~all

        This 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 -all

        This 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 ~all

        Keep 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 all with an intended redirect, publishing +all unintentionally, 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.

        SPF, EXPLAINED
        All guides ↗