Key takeaways
- With SendGrid's default Automated Security setting, you add the CNAME records SendGrid shows you and do not hand-write an SPF string.
- If you turn Automated Security off, you publish an MX record and an SPF TXT record on the em hostname that SendGrid gives you, with include:sendgrid.net in it.
- Either way, your root domain should have exactly one SPF record, and it must include SendGrid if you send from SendGrid for that domain.
An SPF record is a DNS TXT record that lists the servers allowed to send mail for a domain. To authorise SendGrid, the record must include `sendgrid.net`. SendGrid's domain authentication flow can set this up for you through a CNAME, or you can publish the record yourself. Choose the mode first, because the two modes put different records on different hostnames.
Research checked: 12 November 2026
The short answer
With SendGrid's default Automated Security setting, you add the CNAME records SendGrid shows you and do not hand-write an SPF string. If you turn Automated Security off, you publish an MX record and an SPF TXT record on the `em` hostname that SendGrid gives you, with `include:sendgrid.net` in it. Either way, your root domain should have exactly one SPF record, and it must include SendGrid if you send from SendGrid for that domain.
Set up SPF for SendGrid
Step 1: Choose the mode
SendGrid's domain authentication page describes two options:
- Automated Security on (default): SendGrid asks you to publish CNAME records. The `em####` CNAME points SPF authentication at SendGrid's own servers, and two DKIM CNAMEs handle signing.
- Automated Security off: You publish an MX record on `em####`, an SPF TXT record on `em####`, and manual DKIM TXT records.
Automated Security requires a DNS host that accepts underscores in CNAME names. If your host does not, turn it off.
Step 2: Publish the records
For Automated Security on, add the CNAME that SendGrid displays, of the form `em####.example.com` pointing to the target SendGrid shows. The `####` is the number assigned to your account. Copy the target exactly.
For Automated Security off, the SPF record looks like this on the `em####` hostname:
``` em1234.example.com. TXT "v=spf1 include:sendgrid.net ~all" ```
Enter only the hostname part, such as `em1234`, in DNS hosts that append your domain automatically. A full name in that field creates a doubled domain. Enter only the root domain, not `www` or a subdomain, when SendGrid asks for the sending domain.
Step 3: Merge with an existing SPF record
If your root domain already has an SPF record, do not add a second one. Two SPF TXT records on the same name make the check fail. RFC 7208 describes the evaluation: an `include` mechanism is evaluated recursively, and the total number of DNS-lookup terms is limited to 10. Combine the existing list with `include:sendgrid.net` in a single record, for example:
``` example.com. TXT "v=spf1 include:mailer.example.net include:sendgrid.net ~all" ```
`mailer.example.net` here is a placeholder for your other senders. Count the lookups before you add more includes.
Verify the record
Step 4: Verify
Return to SendGrid, select Verify, and wait for the records to resolve. SendGrid's page says DNS verification can take up to 48 hours after upload. Then check from a terminal:
``` dig +short TXT example.com dig +short CNAME em1234.example.com ```
The root lookup should show one SPF string that contains `include:sendgrid.net`. The CNAME lookup should return the SendGrid target you were given.
Worked example
A team sends marketing mail through SendGrid and transactional mail through another provider. Its root domain has `v=spf1 include:mailer.example.net -all`. The fix is to edit that single record to `v=spf1 include:mailer.example.net include:sendgrid.net -all`, not to publish a second record. The example uses `-all`, a hard fail. Use `~all` if you want a softfail while you test. RFC 7208 says a softfail is a weak statement and receivers should not reject on it alone.