# SPF record generator

> Builds an SPF record and counts every DNS lookup, nested includes too, against 10. Free, no signup. We look this up and don't keep it.

**SPF record generator. An SPF record that stays under 10 lookups, no signup.** Use it at https://tools.joinvalley.co/spf-record-generator

## Which SPF terms cost a DNS lookup? Every mechanism, and what it does to your limit of 10.

include, a, mx, ptr, exists and the redirect modifier each cost a DNS lookup, and so does everything inside an include. ip4, ip6 and all cost nothing. RFC 7208 allows 10 lookups in total; past that, SPF returns a permanent error.

| Term | What it matches | Costs a lookup? |
| --- | --- | --- |
| ip4: | An IPv4 address or range | No |
| ip6: | An IPv6 address or range | No |
| a | The domain's own A or AAAA addresses | Yes |
| mx | The domain's mail servers | Yes |
| include: | Whatever another domain's SPF record allows | Yes, plus its own |
| exists: | Any name that resolves, often with macros | Yes |
| ptr | Reverse DNS. RFC 7208 says don't publish it | Yes |
| redirect= | Hands the whole check to another domain's record | Yes |
| all | Everything else; goes last, with ~ or - | No |

Qualifiers: - is fail, ~ is soft fail, ? is neutral, + (the default) is pass. From RFC 7208 sections 4.6.2, 4.6.4, 5 and 6.

Sources: [RFC 7208: Sender Policy Framework (SPF)](https://www.rfc-editor.org/rfc/rfc7208) (read 2026-11-09)

## How it works

Tick who sends mail as your domain, paste any other services' include domains and your own servers' IP addresses, and pick what happens to mail from anywhere else. The record is written in your browser as you go.

Then the draft goes to our server, which follows every include, and every include inside those, and counts the lookups the way receivers do. The domain and the draft aren't kept. A handful of services with nested includes can pass 10 without anyone noticing.

Addresses come first in the record because they cost no lookups, then a and mx, then includes, then all. If nothing sends, you get v=spf1 -all, the record for a domain that never sends mail.

What it can't know is every service that sends as you. Check your email platform, CRM, help desk and billing tool, and copy each one's include from its own setup page.

## Write an SPF record that doesn't break. The three rules that catch most domains.

SPF says which servers may send as your domain. It fails in a few predictable ways.

### One record, never two

A domain must not publish more than one SPF record; if a receiver finds two, SPF returns a permanent error. Adding a service means editing the one record you have, not adding another TXT record that starts with v=spf1.

Sources: [RFC 7208: Sender Policy Framework (SPF)](https://www.rfc-editor.org/rfc/rfc7208) (read 2026-11-09)

### Ten lookups, nested ones included

RFC 7208 limits a check to 10 DNS-querying terms, counting every include, a, mx, ptr, exists and redirect, including those inside the records you include. Microsoft's docs give the arithmetic: an include that points at a record with three more includes costs four lookups. Fewer than 10 includes doesn't mean fewer than 10 lookups.

Sources: [RFC 7208: Sender Policy Framework (SPF)](https://www.rfc-editor.org/rfc/rfc7208) (read 2026-11-09), [Microsoft Learn: Set up SPF for your Microsoft 365 domain](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-spf-configure) (read 2026-10-15)

### Soft fail or fail

~all is a soft fail, a weak statement that other servers probably aren't authorized; -all is a fail, an explicit statement that they aren't. The providers differ: Google recommends ~all for Google Workspace, and Microsoft recommends -all for Microsoft 365 domains, because DMARC effectively ignores a ~all failure on mail that has no DKIM signature.

Sources: [RFC 7208: Sender Policy Framework (SPF)](https://www.rfc-editor.org/rfc/rfc7208) (read 2026-11-09), [Google Workspace Help: Set up SPF](https://knowledge.workspace.google.com/admin/security/set-up-spf) (read 2026-10-15), [Microsoft Learn: Set up SPF for your Microsoft 365 domain](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-spf-configure) (read 2026-10-15)

### Use each provider's exact include

Google Workspace's is include:_spf.google.com and Microsoft 365's is include:spf.protection.outlook.com, each from its own documentation. For any other service, copy the include from its setup page rather than guessing.

A clean SPF record gets you to the inbox. What you say when you're there is the rest. [Valley](https://www.joinvalley.co/?utm_source=tools_suite)

Sources: [Google Workspace Help: Set up SPF](https://knowledge.workspace.google.com/admin/security/set-up-spf) (read 2026-10-15), [Microsoft Learn: Set up SPF for your Microsoft 365 domain](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-spf-configure) (read 2026-10-15)

## Sources

- [RFC 7208: Sender Policy Framework (SPF)](https://www.rfc-editor.org/rfc/rfc7208) (read 2026-11-09)
- [Google Workspace Help: Set up SPF](https://knowledge.workspace.google.com/admin/security/set-up-spf) (read 2026-10-15)
- [Microsoft Learn: Set up SPF for your Microsoft 365 domain](https://learn.microsoft.com/en-us/defender-office-365/email-authentication-spf-configure) (read 2026-10-15)

## Questions people ask

### What is an SPF record?

A DNS TXT record on your domain, starting v=spf1, that lists the servers allowed to send email as that domain.

### How do I create an SPF record?

Tick the services that send as your domain here, add any others and your own IPs, copy the value and publish it as a TXT record on your domain's root.

### What is the SPF record for Google Workspace?

v=spf1 include:_spf.google.com ~all, Google's recommended record when Google Workspace is the only service that sends as your domain.

### What is the SPF record for Microsoft 365?

v=spf1 include:spf.protection.outlook.com -all, Microsoft's record for a domain where only Microsoft 365 sends. Add other senders before the -all.

### What is the SPF 10 DNS lookup limit?

RFC 7208 allows at most 10 DNS-querying terms per check, nested includes counted. Past that, SPF returns a permanent error and fails.

### Can a domain have two SPF records?

No. Two SPF records make SPF return a permanent error. Merge them into one.

### Should I use ~all or -all?

Google recommends ~all for Google Workspace domains; Microsoft recommends -all for Microsoft 365 domains that also use DKIM and DMARC. For a domain that sends no mail, use v=spf1 -all.

### What SPF record should a domain that doesn't send email have?

v=spf1 -all, which says no server is allowed to send as it. It's Microsoft's record for parked domains too.

### Is this SPF generator free?

Yes. It's free and needs no signup. The lookup count runs on our server, which doesn't keep your domain or record.

## Related tools

- [DMARC record generator](https://tools.joinvalley.co/dmarc-record-generator): Writes a DMARC record to RFC 9989, with report addresses, alignment and test mode.
- [DKIM record generator](https://tools.joinvalley.co/dkim-record-generator): Makes a DKIM key pair in your browser and writes the TXT record to publish.
- [SPF, DKIM and DMARC checker](https://tools.joinvalley.co/spf-dkim-dmarc-checker): Checks a domain's SPF, DKIM and DMARC records against Gmail and Yahoo's sender rules.
- [Email setup map](https://tools.joinvalley.co/email-setup-map): Draws a domain's email setup as one diagram: MX, the SPF include tree, DKIM and DMARC.
- [Cold email domain finder](https://tools.joinvalley.co/cold-email-domain-finder): Sending domain ideas close to your brand, each checked against its registry.

## Next step

Want replies, not just clean copy? Valley finds buyers showing real buying signals and messages them across email and LinkedIn. [Valley](https://www.joinvalley.co/?utm_source=tools_suite)

Shelf: [04 Email outreach](https://tools.joinvalley.co/email-outreach)

---

Tools by Valley, made by [Valley](https://www.joinvalley.co/?utm_source=tools_suite). HTML version: https://tools.joinvalley.co/spf-record-generator
