---
title: "SPF Record Generator: Build an SPF Record"
description: "Free SPF record generator. Pick the services that send for your domain, add your own IP ranges, get a valid v=spf1 record, and count its DNS lookups."
canonical_url: "https://smtp.dev/tools/spf-generator/"
---

> Index of every page on this site: [llms.txt](https://smtp.dev/llms.txt)

## How to use the SPF generator

1. Tick every service that sends mail with your domain in the envelope sender: your mailbox provider, your transactional email API, your marketing tool, your helpdesk.
2. Add any servers of your own as `ip4:` or `ip6:` ranges.
3. Choose how to treat everything else. `~all` is the usual choice alongside DMARC.
4. Click **Count real DNS lookups**. The generator resolves the draft record live, without publishing it, and shows the full include tree.
5. Publish the record as a TXT record at the root of the domain (`@` in most DNS panels), replacing any existing `v=spf1` record.

## Examples

Google Workspace plus a transactional provider:

```txt
v=spf1 include:_spf.google.com include:sendgrid.net ~all
```

A single office server and Microsoft 365:

```txt
v=spf1 ip4:203.0.113.25 include:spf.protection.outlook.com -all
```

A domain that never sends mail:

```txt
v=spf1 -all
```

## Keeping under the lookup limit

- Remove includes for services you have stopped using. They still cost lookups.
- Use `ip4:`/`ip6:` for your own servers. They are free.
- Send marketing or bulk mail from a subdomain (`news.example.com`) with its own SPF record.
- Check the record again from time to time. Providers change their own records, and your total can grow without you editing anything.

## Many services use their own envelope domain

Some email services send with their own `Return-Path` domain by default. Then SPF is checked against their domain, not yours, and adding their include to your record changes nothing. It only counts once you configure the provider's custom return-path or bounce domain on a subdomain of yours. That subdomain gets its own SPF record, usually a CNAME or TXT record the provider gives you.

## Sitemap

See the full [sitemap](https://smtp.dev/sitemap.md) for all pages.
