SPF · DKIM · DMARC
Set up SPF, DKIM and DMARC on SendGrid
SendGrid authenticates a sending subdomain with CNAMEs it generates for you — publish them, add DMARC, click Verify, then confirm it landed.
Before you start
What SendGrid needs from your DNS.
SendGrid is a sending platform, not your mailbox host. It sends on your behalf from a dedicated subdomain, and receivers judge that mail on what your DNS says — not on the fact that SendGrid carried it. Domain authentication is how you tell them SendGrid is allowed to send as you: it sets up SPF and DKIM against a subdomain like em1234.yourdomain.com so messages align with the address your recipients see.
Unlike a mailbox provider, SendGrid does not hand you one SPF line to paste. With Automated Security — the default and recommended path — it generates CNAME records that point back into SendGrid, one for the mail stream and return path and two for DKIM under the s1 and s2 selectors. Because they are CNAMEs, SendGrid can rotate the underlying SPF and DKIM keys without you touching DNS again. The values are unique to your account, so there is nothing generic to copy from a guide — you take them from the SendGrid console.
DMARC is the one record SendGrid does not manage for you on the default plan beyond a starter policy. It belongs on your root domain as a TXT record, ties SPF and DKIM back to the domain your recipients see, and tells receivers what to do on failure. Since February 2024 Google and Yahoo require bulk senders to publish all three, so authenticating your SendGrid domain is the gate to the inbox, not an optional polish.
The records to publish
Copy these into your DNS.
Add each record at your DNS provider — the company where your domain is registered, not SendGrid. Then run the checker to confirm every one resolves.
SPF / return-path (CNAME) record
value generated by SendGrid
SendGrid generates the exact host (em plus digits) and the target (u12345.wl123.sendgrid.net) when you start domain authentication — copy both from the console. This CNAME carries SPF and the return path for the sending subdomain. If you disabled Automated Security, SendGrid instead gives you a TXT record of v=spf1 include:sendgrid.net ~all on that subdomain; where you already run SPF on the same name, add include:sendgrid.net to the existing line rather than publishing a second record.
DKIM selector 1 (CNAME) record
value generated by SendGrid
Points to s1.domainkey.u12345.wl123.sendgrid.net — the exact target is generated per account, so take it from the console. SendGrid uses two selectors, s1 and s2, so it can rotate keys without downtime; publish both.
DKIM selector 2 (CNAME) record
value generated by SendGrid
The second DKIM CNAME, pointing to s2.domainkey.u12345.wl123.sendgrid.net. It is not optional — both s1 and s2 must resolve or SendGrid marks domain authentication as failed.
DMARC record
v=DMARC1; p=none; rua=mailto:[email protected]
Publish this once on your root domain, not on the SendGrid subdomain. Start at p=none to watch who sends as you, then raise to quarantine and reject once your reports show every legitimate sender aligning. Point rua at an address you actually read.
Step by step
The whole setup, in order.
- 1 Start domain authentication in SendGrid. In the SendGrid console go to Settings → Sender Authentication → Authenticate Your Domain. Choose your DNS host, enter your sending domain, and leave Automated Security on unless you have a specific reason to manage SPF and DKIM by hand.
- 2 Copy the generated records. SendGrid produces three CNAMEs — one em subdomain for the mail stream and return path, and s1._domainkey and s2._domainkey for DKIM. The hosts and targets are unique to your account, so copy each exactly from the console rather than from any guide.
- 3 Publish the CNAMEs at your DNS host. At your registrar or DNS provider — not in SendGrid — add all three CNAME records exactly as shown. Do not append your domain twice; some panels add it automatically, which turns em1234.yourdomain into em1234.yourdomain.yourdomain.
- 4 Publish DMARC on your root domain. Add the _dmarc TXT record above at the root of your domain. Begin at p=none so you break nothing while you read the reports, and keep the rua address pointed somewhere you will see it.
- 5 Click Verify in SendGrid. Return to the Sender Authentication page and click Verify. SendGrid checks the CNAMEs resolve; if they do not, it tells you which record is missing. Verification can take up to 48 hours after you publish, though it is often much faster.
- 6 Confirm with a full check. Once SendGrid shows the domain as verified, run a full check here to confirm the s1 and s2 selectors resolve, SPF stays under the 10-lookup limit, and DMARC is graded.
Where it goes wrong
The mistakes specific to SendGrid.
Confirm it worked
Do not trust it until you have checked it.
DNS takes a few minutes to propagate. Once it has, run a full check: it reads all three records live, counts your SPF lookups, confirms the SendGrid DKIM selector resolves, and grades your DMARC policy — the exact things that decide whether Gmail and Outlook trust your mail.
Common questions
About SendGrid, specifically.
Set it once. Know it stays set.
A DKIM key rotates, a vendor changes its SPF, an IP gets listed — and your carefully-configured domain quietly breaks. Monitoring watches all of it and tells you the day it changes.