SPF record generator

Build the SPF record for your domain. Tick the services that send email for you, add any of your own servers, and copy the finished TXT record. It counts the DNS lookups as you go, so you stay under SPF's limit of 10.

Services that send email as you

The number on each one is how many of your 10 DNS lookups it uses, checked November 2026. Providers change their records now and then.

Your own servers

IPv4 or IPv6, with or without a range like /24, separated by commas, spaces or new lines. These use no lookups.

Domains from another service's setup instructions, written after include:. Each counts as at least 1 lookup.

Email from anywhere else
Already have an SPF record? Import it

Your SPF record

Type

TXT

Name or host

@

Value

v=spf1 ~all

    Everything runs in your browser. Nothing you type is stored or sent anywhere. Once it's published, check it with the email DNS checker.

    How this generator works

    SPF (Sender Policy Framework) is a TXT record on your domain listing the servers allowed to send email as you. Receiving servers check it against the server that actually sent each message. The generator puts the record together from what you tick:

    It also counts DNS lookups. The SPF standard (RFC 7208) lets a receiver make at most 10 DNS lookups while checking your record, counting every include, a, mx, ptr, exists and redirect, including the ones inside the services you include. Go over 10 and SPF returns a "PermError", which counts as a fail, so email from every service on the list can start going to spam. IP addresses don't use any lookups.

    Over the limit? Flattening and other fixes

    If you're over 10, try these in order:

    1. Remove services you no longer use. Old newsletter tools and previous email hosts are the usual culprits.
    2. Send bulk email from a subdomain. Marketing tools can usually send from something like news.example.co.uk, which has its own SPF record and its own 10 lookups.
    3. Drop mx and a if those servers don't actually send email.
    4. Flatten as a last resort. Flattening replaces an include with the IP addresses it currently resolves to, so it uses no lookups. The catch is that when the provider changes its addresses your record goes out of date and their email starts failing, so it needs checking regularly or a service that does it automatically.

    Our guide to fixing "too many DNS lookups" goes through each step in detail.

    Common provider includes

    ServiceIncludeLookups

    Tips

    Frequently asked questions

    What is an SPF record?

    A TXT record in your domain's DNS that lists the servers allowed to send email for your domain. It starts v=spf1 and ends with an all rule for everything else.

    Where do I add the SPF record?

    Wherever your domain's DNS is managed, usually where you bought the domain or Cloudflare. Add a TXT record with the host or name @ (meaning the domain itself; some panels want it left blank) and the value from the generator. If there's already a v=spf1 record, edit that one instead of adding a second.

    Should I use ~all or -all?

    Either is fine once DMARC is in place, because DMARC decides what happens to failing email. ~all is the common default and safer while you're still finding every service that sends for you. -all is stricter and suits a domain whose senders you're sure of.

    What is the SPF 10 lookup limit?

    Receivers stop after 10 DNS lookups when checking SPF. Every include, a, mx, exists and redirect counts, including those nested inside includes. Over 10, SPF fails with a PermError.

    Can I have two SPF records?

    No. Two v=spf1 records on the same name make SPF fail. Combine everything into one record.

    How long until a new SPF record works?

    Usually minutes, but up to the old record's TTL (often an hour, sometimes a day) before every receiver sees the change.

    Does it save or send what I type?

    No. The record is built in your browser and nothing is stored or sent anywhere. It doesn't look anything up either, so to check a published record use the email DNS checker.