# SPF record generator

> Build a correct SPF record for free: tick your mail services, add IP ranges, choose ~all or -all. DNS lookups counted against the limit of 10. In your browser.

Canonical: https://mobilevalidate.com/tools/spf-record-generator · Last updated: 2026-11-22

Tick the services that send mail for your domain, add your own servers or IP ranges and choose what happens to mail from anywhere else. The generator writes one valid SPF record to publish as a DNS TXT record, counts the DNS lookups against the limit of 10, explains every part and warns about common mistakes such as +all or a second record. It runs in your browser.

Use the tool: https://mobilevalidate.com/tools/spf-record-generator (interactive; needs a browser with JavaScript).

**Privacy:** Runs entirely in your browser. Nothing you type, paste or upload is sent to MobileValidate or anyone else, and nothing is stored. The page counts one anonymous "tool used" event per visit (no numbers, no text), and sends nothing at all when your browser asks not to be tracked.

## How it works

**Who may send.** Each service you tick adds the include its own setup guide documents, such as `include:_spf.google.com` for Google Workspace. Your own servers are added with `ip4:` and `ip6:` (no DNS lookups) or with `mx` and `a`. Entries that are not valid IP addresses, ranges or domain names are left out and listed.

**Everyone else.** The record ends with `~all` (soft fail), `-all` (fail) or `?all` (neutral). For a domain that sends no mail, the record is `v=spf1 -all`.

**Checked like a published record.** The record goes through the same parser and rules as our [SPF and DMARC checker](https://mobilevalidate.com/tools/spf-dmarc-checker): each part is explained, `a`, `mx` and every include count one DNS lookup, and an include adds the lookups of its own record. For the listed services we use the counts we read from their records on 2026-11-22; a custom include counts at least 1, so check the real total once it is published.

Nothing is looked up and nothing leaves the page: the record is built on your device.

## ~all or -all?

- **~all (soft fail):** mail from servers not in the record is marked as suspicious but usually still delivered. The safe choice while you find every service that sends for you, and common in practice because DMARC decides what happens to failing mail.
- **-all (fail):** mail from servers not in the record fails SPF, and receivers may reject it outright. Use it when you are sure the list is complete, and always for domains that send no mail.
- **?all (neutral):** SPF gives no opinion about other servers, so it protects nothing. Only for short tests.
- **+all:** lets every server on the internet pass. Never use it; the generator does not offer it.

With a DMARC policy of quarantine or reject, receivers act on DMARC, so ~all and -all end up close. Build the matching record with the [DMARC record generator](https://mobilevalidate.com/tools/dmarc-record-generator).

## Authenticated mail still bounces from dead addresses

SPF proves the mail is yours; bounces from addresses that no longer exist still hurt your sender reputation. Verify addresses before you send. Unknown answers are free.

- [Start free (20 free real checks)](https://mobilevalidate.com/request-access?service=email.valid)
- [How e-mail verification works](https://mobilevalidate.com/services/email-verification)

## Related

- [SPF and DMARC checker](https://mobilevalidate.com/tools/spf-dmarc-checker.md)
- [DMARC record generator](https://mobilevalidate.com/tools/dmarc-record-generator.md)
- [Check if an e-mail mailbox exists](https://mobilevalidate.com/services/email-verification.md)
- [Free e-mail checker](https://mobilevalidate.com/tools/email-checker.md)
- [MX record](https://mobilevalidate.com/glossary/mx-record.md)

## Frequently asked questions

### What is an SPF record?

A DNS TXT record at your domain, starting with `v=spf1`, that lists the servers allowed to send mail for it. Receivers compare the sending server with the list and pass, soft-fail or fail the message. Together with DKIM and DMARC it is how mailbox providers tell your mail from spoofed mail.

### Where do I publish the SPF record?

At your domain itself (host `@` in most DNS panels), as a record of type TXT. Use one TXT record only: if the domain already has a `v=spf1` record, replace it with the new one. The old SPF record type is obsolete; receivers only read TXT.

### Can I have two SPF records?

No. With two `v=spf1` records, receivers return a permanent error and SPF fails for all your mail. Put every service into one record, which is what this generator does.

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

RFC 7208 lets a receiver make at most 10 DNS lookups while it evaluates your record: a, mx, ptr, exists, redirect and every include count, and so do the lookups inside each include. Over 10, SPF fails. ip4 and ip6 entries cost nothing, so replace an include you no longer need, or list fixed servers by IP.

### Is SPF enough to stop spoofing?

No. SPF checks the envelope sender, which people never see, not the From address. DMARC ties SPF and DKIM to the visible From domain and tells receivers what to do when both fail. Publish SPF, DKIM and a DMARC record; since February 2024 large mailbox providers require them from bulk senders.

### Is anything I enter sent anywhere?

No. The record is built and checked in your browser; nothing you enter is sent to MobileValidate or anyone else, and nothing is stored. To read a published record back from DNS, with every include followed, use the [SPF and DMARC checker](https://mobilevalidate.com/tools/spf-dmarc-checker).
