Opens in a new tab

SendGrid SPF, DKIM and DMARC setup

SendGrid’s domain authentication handles both SPF and DKIM with CNAME records on your domain: a return-path subdomain (em1234.yourdomain.com) that makes SPF align, and two DKIM selectors, s1 and s2. With it — automated security, the default — you add nothing to your root SPF record.

SPFNot needed with automated security
DKIMCNAMEs s1 and s2
Bounce domainem<number>.<your domain> — SPF aligns
Set up inSettings → Sender Authentication

Is your domain set up for SendGrid?

We read your SPF record, look for SendGrid’s DKIM key and check DMARC. Nothing is stored.

SPF for SendGrid

With automated security on — the default — SendGrid says it “handles the signing of your DKIM and the authentication of your SPF with CNAME records”. The bounce address is em<number>.yourdomain.com, a CNAME to SendGrid, so SPF passes for a subdomain of yours and aligns under DMARC’s relaxed default. Nothing goes in your root SPF record.

Only with automated security switched off do you publish v=spf1 include:sendgrid.net ~all yourself, on the return-path subdomain SendGrid names.

DKIM for SendGrid

In SendGrid, go to Settings → Sender Authentication → Authenticate Your Domain and publish the records it gives you. SendGrid signs with one of the two selectors at a time, which lets it rotate keys without you touching DNS.

Before you authenticate, mail is signed by SendGrid’s own domain and shows “via sendgrid.net” in Gmail.

NameTypeValue
em<number>CNAMEu<id>.wl<id>.sendgrid.net
s1._domainkeyCNAMEs1.domainkey.u<id>.wl<id>.sendgrid.net
s2._domainkeyCNAMEs2.domainkey.u<id>.wl<id>.sendgrid.net

The exact values come from SendGrid; copy them from there. Placeholders are in angle brackets.

Bounce domain and DMARC

With domain authentication done, SendGrid mail passes DMARC on both SPF (the em subdomain) and DKIM (s1/s2). SendGrid’s setup also offers a starter record, v=DMARC1; p=none; — publish it only if you have no DMARC record already.

No DMARC record yet? Start with one that only reports, read the reports for a couple of weeks, then tighten it: build it with the DMARC generator.

Common mistakes

  • DNS hosts that append your domain, turning em1234.yourdomain.com into em1234.yourdomain.com.yourdomain.com. Enter only the host part.
  • Adding include:sendgrid.net to the root SPF record out of habit: with automated security it authorises nothing and costs lookups.
  • Publishing SendGrid’s starter DMARC record next to an existing one — a domain may have only one.

Questions

Why does Gmail show “via sendgrid.net”?

The domain is not authenticated yet, so SendGrid signs with its own domain. It disappears once the s1 and s2 CNAMEs verify.

Sources

Checked against SendGrid’s own documentation on 25 September 2026:

See every service’s mail pass or fail

Point your DMARC reports at us and we name every server sending as your domain, with what passes, what fails and the exact fix. Free for your first domain.

Create a free account