SPF Record Generator
Build a valid SPF record for your sending domain, count DNS lookups, and compare it with what is live.
Runs in your browserFree, no account needed
Sending sources
Tick every service that sends mail from this domain. The record updates live.
The domain in your From address. Each secondary domain needs its own record.
Add your own include, ip4, ip6, a or mx mechanisms for self-hosted servers or providers not listed.
Recommended. Unauthorized senders softfail, which DMARC already treats as an SPF failure, and forwarded mail is less likely to be rejected outright.
How to add this at your DNS host
- Open the zone, then DNS, then Records.
- Add record: Type TXT, Name @, Content the record above, TTL Auto.
- Cloudflare splits strings over 255 characters automatically. Save.
- Delete any other TXT starting with v=spf1 on the same name.
Your SPF record
Pick at least one sending source
You will get the exact TXT value, a DNS lookup count, and a comparison with what is already published.
How it works
How to use the SPF Generator
- 01
Pick your sending sources
Select the providers that send from this exact domain and add custom includes or IP ranges for anything else. Only list services that actually send.
- 02
Choose a policy
Keep ~all unless every source is verified. The record, host, lookup count and length update as you go.
- 03
Compare and publish
Enter the domain and check the current record. Publish the new one as a TXT record on the root of the domain at your DNS host.
Guide
What an SPF record is and how receivers use it
SPF (Sender Policy Framework) is a TXT record on your domain that lists which servers may send mail using that domain in the envelope sender, the MAIL FROM address also called the Return-Path. When a receiving server gets a message, it looks up the SPF record for the envelope domain, walks the mechanisms in order, and stops at the first one that matches the connecting IP. The qualifier on that mechanism decides the result: pass (+), fail (-), softfail (~) or neutral (?). If nothing matches, the trailing all mechanism sets the default.
Mechanisms are simple. ip4 and ip6 list addresses or CIDR ranges directly. a and mx say "whatever the A or MX records of this hostname point to". include pulls in another domain's SPF record, which is how you authorize a provider: include:_spf.google.com means "any IP Google publishes may send as me". A domain can have only one SPF record; two records starting with v=spf1 is a permanent error and receivers treat it as no SPF at all.
SPF alone is weak, because the envelope sender is invisible to the reader and easy to set. Its real value comes through DMARC, which checks that the SPF-authenticated domain aligns with the visible From header. That is why a cold email domain needs SPF, DKIM and DMARC together rather than any one of them.
The 10 DNS lookup limit, and why it silently breaks SPF
RFC 7208 caps the number of DNS-querying mechanisms at 10 per evaluation. include, a, mx, redirect, exists and ptr each cost one lookup, and every include is followed recursively, so the includes inside your provider's record count against your total. ip4 and ip6 are free. Exceed the limit and receivers return permerror, which DMARC treats as an SPF failure. There is no warning; the record simply stops working, usually the day a new marketing tool was added.
The generator counts your direct lookups and adds an estimate for the nested includes of each provider. Google Workspace's include, for example, pulls in three netblock records, so it costs about four lookups on its own. The estimates change as providers restructure their records, which is why the tool flags anything at 8 or above as close to the limit rather than waiting for 11.
- Only include providers that send from this exact domain. A CRM that sends from your primary domain has no place in a secondary domain's record.
- Prefer ip4 and ip6 for servers you control; they never count toward the limit.
- If you cannot get under 10, move low-volume tools to a subdomain with its own SPF record.
- Never use ptr. It is deprecated, slow, and counts as a lookup.
Which policy to use: ~all, -all or ?all
The all mechanism sets the result for any IP that matched nothing else. ~all (softfail) says unlisted senders are probably not legitimate; -all (fail) says they definitely are not; ?all (neutral) says nothing. For DMARC purposes softfail and fail are the same, both count as an SPF fail, so ~all loses no protection once DMARC is in place. It does avoid one problem: a few receivers reject mail on SPF -all at connection time, before DKIM and DMARC are evaluated, which breaks forwarded mail that would otherwise have passed on DKIM.
The practical recommendation for cold email domains is ~all together with a DMARC policy that will eventually reach reject. Move to -all only when every sending source has been verified through DMARC reports for several weeks. ?all should never be published; it gives receivers no signal and offers no spoofing protection. +all authorizes the whole internet and is treated by many filters as a spam signal in itself.
SPF for cold email: one record per secondary domain
Since February 2024, Gmail and Yahoo require every sender to authenticate with SPF or DKIM, and senders of 5,000 or more messages a day to a provider to publish SPF, DKIM and DMARC and keep spam complaints under 0.3%. Microsoft applied matching requirements to Outlook.com in 2025. Cold email teams typically spread volume across several secondary domains, and each one is a separate sending domain in the eyes of these rules. Each needs its own SPF record listing only the provider that hosts its inboxes, usually Google Workspace or Microsoft 365.
Do not copy your primary domain's record onto secondary domains. The primary record lists your CRM, billing tool, support desk and newsletter platform, none of which send from the outreach domain, and the extra includes waste lookups and widen the attack surface. A secondary domain record is usually a single include and ~all, well under the limit. After publishing, use the checker above to confirm the live record matches, then set up DKIM and DMARC. ColdBox runs the same check on every sending domain and spells out the fix when a record is wrong.
SPF Generator questions
Something else? Ask us.
Where do I add the SPF record?
At your DNS host, as a TXT record on the root of the domain. The host or name field is @ or left blank, and the value is the full string starting with v=spf1. It is not added in Google Workspace or Microsoft 365; those services only tell you which include to use. Propagation usually takes minutes, occasionally up to an hour.
Can I have more than one SPF record on a domain?
No. Multiple TXT records beginning with v=spf1 on the same name are a permanent error, and receivers treat the domain as having no SPF at all. If you use several services, combine their mechanisms into one record. If you already have a record, edit it rather than adding a second one.
What is the SPF 10 lookup limit?
RFC 7208 limits an SPF evaluation to 10 DNS-querying mechanisms: include, a, mx, redirect, exists and ptr, counted recursively through every include. Exceeding it returns permerror, which DMARC counts as an SPF failure. ip4 and ip6 mechanisms do not count, so listing your own servers by IP keeps you under the limit.
Should I use ~all or -all for cold email?
Use ~all. DMARC treats softfail and fail identically, so ~all loses no protection once DMARC is published, and it avoids the small number of receivers that reject on -all before checking DKIM, which can drop legitimately forwarded mail. Move to -all only after several weeks of DMARC reports show every sending source is listed.
Does SPF need to be on every secondary domain I send from?
Yes. Each secondary domain is an independent sending domain and needs its own SPF record listing the provider that hosts its inboxes. Google and Yahoo require SPF or DKIM on every sending domain, and both for bulk senders. Copying the primary domain's record is a mistake; the secondary record should usually be one include and ~all.
The record is longer than 255 characters. Is that a problem?
Not by itself. A single DNS TXT string is limited to 255 characters, but a record can consist of several strings that receivers concatenate. Most DNS hosts split long values automatically. If yours does not, enter the value as multiple quoted strings. The generator warns you when the record crosses 255 characters.
How does the check current record feature work?
It queries the TXT records for your domain through DNS-over-HTTPS from your browser, finds the string starting with v=spf1, and compares its mechanisms to the record you generated. It shows which mechanisms would be kept, added and dropped, and whether the providers you selected are already present. It never modifies anything.
Further reading
All articlesMore free tools
Keep going with these
Every tool is free, works without an account, and is built for cold email teams.
- DeliverabilityDKIM Record GeneratorGenerate a 2048-bit DKIM key pair in your browser, get the DNS record, and check any live selector.Open the tool
- DeliverabilityDMARC Record GeneratorGenerate a DMARC TXT record with every tag explained, check your live record, and follow a safe rollout plan.Open the tool
- InfrastructureSecondary Domain Generator for Cold EmailGenerate up to 60 lookalike domains for cold email, check DNS in bulk, and jump straight to a registrar.Open the tool
Connect a mailbox today. Send your first campaign this week.
Warmup is free on every plan, and a campaign can go out as soon as your accounts are ready. Try it free for 14 days, no credit card.