How to Set Up an SPF Record: Step-by-Step Guide
Publish one SPF TXT record per domain, ending in ~all or -all. Worked examples for Google Workspace, Microsoft 365 and SendGrid, plus the 10-lookup limit.
ProfitTool Team
Security & Dev
Step 1: Identify All Your Sending Sources
Before creating the record, list every service that sends email from your domain:
- Your primary email provider (Google Workspace, Microsoft 365, Zoho)
- Transactional email services (SendGrid, Mailchimp, Postmark, SES)
- Marketing tools (HubSpot, Klaviyo, Mailchimp)
- CRM tools that send automated emails
- Your own mail server if self-hosted
Missing a sending source means those emails may fail SPF checks.
Step 2: Build the SPF Record
Google Workspace
v=spf1 include:_spf.google.com ~allMicrosoft 365
v=spf1 include:spf.protection.outlook.com ~allSendGrid
v=spf1 include:sendgrid.net ~allMultiple providers
v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.10 ~allStep 3: Choose Your All Mechanism
-all— Hard fail: reject unlisted senders. Use once you are confident your record is complete.~all— Soft fail: mark but accept unlisted senders. Safe starting point.?all— Neutral: no policy. Provides no protection.- Avoid
+all— passes all senders, defeats the purpose.
Step 4: Publish the DNS Record
Add a TXT record at your domain root:
| Name | Type | Value |
|---|---|---|
| @ | TXT | v=spf1 include:_spf.google.com ~all |
Most DNS control panels use @ to represent the root domain.
Step 5: Wait for Propagation and Verify
DNS changes typically propagate within minutes to hours. Then verify with our SPF Record Checker.
Common Mistakes to Avoid
- Publishing two SPF records (only one
v=spf1TXT record is allowed) - Exceeding 10 DNS lookups (each
include:,a,mxcounts) - Forgetting to add new sending services when they are onboarded
ProfitTool Team
Security & DevWritten and maintained by the ProfitTool team. Where an article references a ProfitTool utility, the behaviour described is the behaviour of the tool on this site — you can open it and check the output yourself.
More from the Knowledge Hub
How to Fix a DMARC Record: Common Errors and Solutions
DMARC misconfigurations can cause legitimate email to be rejected or leave your domain unprotected. This guide covers the most common DMARC errors and how to fix them.
Privacy & SecurityWhat Is an SPF Record and How Does It Work?
SPF (Sender Policy Framework) records tell receiving mail servers which IP addresses are authorised to send email for your domain. Here is how to read and set one correctly.
Privacy & SecurityWhat Is DMARC and How Do You Set It Up?
DMARC builds on SPF and DKIM to give domain owners control over what happens to unauthenticated email. This guide covers how DMARC works and how to configure it safely.