The exact SPF record
Copy the example that matches your setup. Each one is a single TXT record; the host is shown as your DNS provider usually expects it (@ means the domain itself).
Automated security off: TXT on the return-path subdomain SendGrid gives you
Type: TXT · Host: em1234 · 2 of 10 DNS lookups
v=spf1 include:sendgrid.net ~all
Use the exact subdomain SendGrid shows; em1234 is an example. SendGrid also asks for an MX record there: mx.sendgrid.net.
Your main domain on Microsoft 365 stays as it is
Type: TXT · Host: @ · 1 of 10 DNS lookups
v=spf1 include:spf.protection.outlook.com -all
Your main domain on Google Workspace stays as it is
Type: TXT · Host: @ · 1 of 10 DNS lookups
v=spf1 include:_spf.google.com ~all
How SPF applies to SendGrid mail
SendGrid sends with a bounce (MAIL FROM) address on a subdomain set up for it, and receivers check SPF on that subdomain. Your main domain's SPF record doesn't need to change for SendGrid.
- SendGrid's SPF article shows
v=spf1 include:sendgrid.net -allas a typical record. With domain authentication, that record belongs on the return-path subdomain, which is the domain SPF actually checks for SendGrid mail. - With automated security on, SendGrid updates the SPF and DKIM records for you, for example when you add a dedicated IP address. With it off, you must update them yourself.
How to add it
- In SendGrid, start domain authentication for the domain you send from (for example
example.com). - Under Advanced Settings, keep Use automated security on unless your DNS host can't store underscores in CNAME records.
- Optionally set a custom return path if you need a specific subdomain label instead of SendGrid's random one.
- Publish exactly the records SendGrid shows: with automated security, one CNAME for the return path (SPF), two DKIM CNAMEs and a DMARC TXT record.
- Verify in SendGrid, then check the return-path subdomain with the SPF Checker below.
DKIM and DMARC alignment
With automated security on, DKIM uses two CNAMEs (s1._domainkey and s2._domainkey) that point to SendGrid; with it off, a DKIM TXT record (m1._domainkey). Because the return path is a subdomain of your From domain, SPF aligns under DMARC's default relaxed alignment, and DKIM aligns too.
DMARC passes when SPF or DKIM passes and the domain it checked matches your From domain. Our guide to SPF, DKIM and DMARC explains how the three fit together.
Common mistakes
- Two SPF records. A domain may publish only one record that starts with
v=spf1. With two, receivers return a permanent error and SPF fails for all your mail (RFC 7208 section 3.2). Merge every sender into one record. - More than 10 DNS lookups. Each
include,a,mx,existsandredirectcosts a lookup, nested ones included; over 10 is a PermError (section 4.6.4). SendGrid's include costs 2 on its own. See how to fix too many SPF lookups. - Choosing
~allor-allwithout a plan. SendGrid's documentation uses~all.-allasks receivers to reject unlisted servers;~allasks them to accept but mark the mail. Once DMARC is enforced, receivers act on DMARC instead. Read SPF soft fail vs hard fail before you choose. - Adding
include:sendgrid.netto your root record when you've already authenticated the domain. SPF for SendGrid mail is checked on the return-path subdomain, so the root include spends 2 lookups for nothing. - A custom return-path CNAME that matches an existing CNAME overwrites it. Check your DNS first.
Check your SPF record
See your live record, every nested include and the real lookup count. Free, reads public DNS only.
Building a new record? Open the SPF Record Generator with SendGrid filled in.
Frequently asked questions
Do I need include:sendgrid.net in my SPF record?
Not in your root record if you use SendGrid's domain authentication. SPF is checked on the return-path subdomain SendGrid creates (for example em1234.example.com). With automated security on, a CNAME there covers it; with it off, you publish v=spf1 include:sendgrid.net ~all on that subdomain.
What does SendGrid's automated security do?
It lets SendGrid host and update your SPF and DKIM records through CNAMEs, for example when you add a dedicated IP. It is on by default. Turn it off only if your DNS host can't accept underscores in CNAME records.
Does SendGrid mail pass DMARC?
Once domain authentication is complete, yes: DKIM signs with your domain and the return path is a subdomain of it, so both align under DMARC's relaxed default. Publish a DMARC record on your main domain.
Sources
- Twilio SendGrid Docs: Set up domain authentication
- Twilio SendGrid Docs: Verify senders with SPF
- RFC 7208: Sender Policy Framework (SPF)
Values checked against SendGrid's documentation on October 9, 2026. Lookup counts measured with our SPF Checker on October 9, 2026; providers change their records, so check yours before relying on a number.
SPF records for other providers
- Microsoft 365include:spf.protection.outlook.com
- Google Workspaceinclude:_spf.google.com
- Zoho Mailinclude:zoho.com
- GoDaddyinclude:secureserver.net
- Fastmailinclude:spf.messagingengine.com
- Proton Mailinclude:_spf.protonmail.ch
- Amazon SESinclude:amazonses.com
- Mailguninclude:mailgun.org
- PostmarkNone needed
- MailchimpNone needed
- BrevoNone for standard sending; spf.brevo.com with a dedicated IP
- HubSpotAccount-specific (copy from HubSpot)
- KlaviyoNone needed
- Salesforceinclude:_spf.salesforce.com
- Zendeskinclude:mail.zendesk.com
- Freshdeskinclude:email.freshdesk.com
- IntercomNone needed
Related guides
SPF record syntax and examples
SPF record syntax explained: mechanisms, qualifiers and modifiers, with copy-ready examples for Microsoft 365, Google Workspace, subdomains and parked domains.
9 min read SPF, DKIM & DMARCHow to fix SPF PermError: too many DNS lookups
Why SPF breaks at 10 DNS lookups, how to count them, and step-by-step fixes for Microsoft 365 and Google Workspace domains with many senders.
8 min read SPF, DKIM & DMARCSPF softfail vs hardfail: should you use ~all or -all?
What ~all, -all and ?all mean in SPF, what receivers really do with each, how DMARC changes the choice, and which one to use for sending and parked domains.
8 min readLast updated