Free tool · runs in your browser

SPF record generator

Choose the servers and services that send mail for your domain and the generator writes one SPF record. Publish it as a TXT record at the domain itself. It counts the DNS lookups against the limit of 10 and warns when the record passes 255 characters.

Who sends mail for this domain
Mail from anywhere else

TXT record at the domain itself (host @)

v=spf1 ~all

    Last reviewed

    What goes into an SPF record?

    An SPF record lists who may send mail as your domain. mx allows the domain's own mail servers, a its web address, ip4 and ip6 fixed addresses or ranges, and include another domain's list, which is how mail providers and sending services publish theirs. Take each include from your provider's documentation. The record ends with what happens to mail from anywhere else.

    Should it end in ~all or -all?

    ~all is a soft fail: mail from servers not listed is treated as suspicious. -all is a fail: such mail does not pass SPF. ~all is the usual choice while you are still finding every service that sends for the domain; move to -all once the list is complete.

    Why does the lookup count matter?

    SPF allows 10 DNS lookups per check (RFC 7208, section 4.6.4). include, a, mx, ptr, exists and redirect each cost one; ip4, ip6 and all cost none. Every include also spends lookups of its own, so the count shown here is a floor. Past 10, receivers return a permanent error and SPF fails. Replacing an include with the IP ranges it stands for saves lookups, but the ranges can change without notice.

    What about the 255-character warning?

    A single string in a DNS TXT record holds at most 255 characters. A longer SPF record is published as several quoted strings in one TXT record, which receivers join. Most DNS panels split it for you; some need the quotes typed in.

    What the generator does not do

    It writes a record; it does not publish it or read the one your domain has now. A domain may have only one SPF record, so if it already has one, edit that record instead of adding a second. To see what a domain publishes today, use the SPF, DKIM and DMARC checker.

    Questions

    Where do I publish the SPF record?

    As a TXT record at the domain itself. Most DNS panels show that host as @ or want the host field left empty.

    Do cold-email domains need SPF?

    Yes. Google asks every sender to Gmail for SPF or DKIM, and bulk senders for SPF, DKIM and DMARC. Outboxes publishes these records for the domains it hosts mailboxes on.

    Can a domain have two SPF records?

    No. With two, receivers return a permanent error and SPF fails. Put every sender into one record.

    Does the record count includes inside includes?

    No. The count covers the terms in this record. Each include adds the lookups in its own record, which the generator does not fetch.

    Related tools and pages

    From €0.67 per inbox · 25 inboxes minimum

    See pricing