Adding an SPF Record
Last Updated: March 2026
2 min read
A Sender Policy Framework (SPF) record is a DNS record used for verifying your sent emails. The record identifies which mail servers are permitted to send email on behalf of your domain, which prevents spammers from forging emails using your domain. SPF records use the TXT record type.
Example SPF Record
| Type | Host | Answer | TTL |
|---|---|---|---|
| TXT | example.com | v=spf1 include:_spf.google.com ~all | 300 |
Note: To set up DNS records through your registrar, you need to be using their nameservers so they can manage and host your DNS.
Steps to Add an SPF Record
- Log in to your domain registrar account.
- Navigate to your domains list.
- Click on the domain name you wish to create an SPF record for.
- Click Manage DNS Records.
- Here you will add the desired SPF record, provided by your email host:
- Select TXT in the Type drop-down menu.
- If provided a subdomain or host, enter it in the Host field.
- Enter or copy+paste the SPF value (string) into the Answer field.
- Leave TTL as 300 (default).
- Click the Add Record button.
Once the records are created, it should be working within 24 hours.
Common SPF Record Examples
Google Workspace / Gmail
v=spf1 include:_spf.google.com ~all
Microsoft 365
v=spf1 include:spf.protection.outlook.com ~all
Multiple email providers
v=spf1 include:_spf.google.com include:spf.protection.outlook.com ~all
Understanding SPF Syntax
| Element | Meaning |
|---|---|
v=spf1 | Identifies this as an SPF record (required) |
include: | Authorizes a third-party email server |
ip4: | Authorizes a specific IPv4 address |
ip6: | Authorizes a specific IPv6 address |
a | Authorizes the domain’s A record IP |
mx | Authorizes the domain’s MX servers |
~all | Soft fail — emails from unauthorized servers are marked but delivered |
-all | Hard fail — emails from unauthorized servers are rejected |
?all | Neutral — no policy applied |
Important Notes
- You should only have one SPF TXT record per domain. If you need to authorize multiple providers, combine them into a single record.
- SPF records have a 10-lookup limit. Too many
includestatements can cause SPF validation to fail.
Tags:
dns
spf
email
txt record
email authentication
domains