Suped

How to set up DMARC/DKIM/SPF for Sendgrid

Published 4 Jul 2026
Updated 5 Nov 2026
12 min read
Summarize with
SendGrid domain authentication setup for SPF, DKIM, and DMARC.
Updated on 5 Nov 2026: We corrected SendGrid setup guidance and added account checks before DMARC enforcement.
Configure Domain Authentication inside Twilio SendGrid, publish its generated SPF and DKIM DNS records, then review or add the DMARC record at _dmarc. SendGrid generates the hostnames first, DNS proves control of the domain, and DMARC reports show whether real mail passes.
  1. Best path: Use SendGrid Domain Authentication with Automated Security on, publish the CNAME records SendGrid gives you, then verify in SendGrid.
  2. SPF path: Let SendGrid manage SPF for the bounce domain through CNAME records unless your setup uses manual DNS records.
  3. DKIM path: Publish both DKIM CNAME records, then send a real message and check that the DKIM signing domain matches your visible From domain.
  4. DMARC path: Start with reporting at p=none, then move to enforcement once every legitimate sender on the domain passes DMARC.
What SendGrid changes
SendGrid Automated Security delegates a bounce subdomain and DKIM selectors to SendGrid with CNAME records. SendGrid then manages the underlying SPF and DKIM values behind those CNAME targets.

Authenticate your domain in SendGrid

Start in SendGrid so it generates account-specific DNS records. You need a domain you control and access to its authoritative DNS zone; use the generated values rather than copying the examples below.
Twilio SendGrid Sender Authentication page with Domain Authentication controls.
Twilio SendGrid Sender Authentication page with Domain Authentication controls.
  1. Open settings: In Twilio SendGrid, go to Settings, then Sender Authentication, then Domain Authentication, then Get Started.
  2. Pick DNS host: Select your DNS host. Choose Other Host when the exact provider is not listed.
  3. Choose links: Turn branded links on only when click and open tracking links need to use your own domain.
  4. Enter the domain used in your visible From address. Omit the email local part and any URL prefix; authenticate the exact sending subdomain when strict DKIM domain matching is required.
  5. Keep security: Leave Use automated security on unless your DNS provider rejects CNAME hosts with underscores.
  6. Publish DNS: Copy the records into DNS exactly, wait for propagation, then return to SendGrid and click Verify.

Setup choice

Use when

DNS work

Automated
Most accounts
Three CNAMEs, plus a DMARC TXT record if needed
Manual
DNS rejects underscores in CNAMEs but accepts them in TXT records
MX and TXT
Custom return path
Choose the bounce-subdomain label
Generated Return-Path record; exact SPF matching is not automatic
Choose Automated Security first; a custom Return-Path is an optional setting.
Illustrative Automated Security DNS recordsdns
CNAME em123 u1234567.wl000.sendgrid.net CNAME s1._domainkey s1.domainkey.u1234567.wl000.sendgrid.net CNAME s2._domainkey s2.domainkey.u1234567.wl000.sendgrid.net TXT _dmarc v=DMARC1; p=none;
DNS hostname and collision traps
Many DNS providers append the root domain automatically. If SendGrid shows em123.example.com as the host, enter em123 when your DNS UI already appends example.com.
Check each hostname for an existing DNS record before saving a CNAME. A CNAME cannot share a hostname with other DNS data, and overwriting an existing custom return-path record can break its current use.

Set up SPF

With Automated Security on, do not add include:sendgrid.net to your root SPF record solely for SendGrid. SendGrid uses a Return-Path subdomain, such as em123.example.com, and manages SPF behind the CNAME target. SPF evaluates the envelope MAIL FROM domain, normally visible in the delivered Return-Path header, rather than the visible From address.
SendGrid Automated Security and custom Return-Path settings for SPF authentication.
SendGrid Automated Security and custom Return-Path settings for SPF authentication.
  1. Use CNAME path: Keep Automated Security on so SendGrid controls SPF for the Return-Path subdomain.
  2. Check Return-Path: Send a test message and inspect the Return-Path header for a subdomain under your domain.
  3. Keep one SPF: Do not create a second SPF TXT record at the same host; merge required mechanisms into the existing SPF record.
  4. Use manual only: If Automated Security is off, publish the SPF TXT that SendGrid shows for the bounce subdomain.
Illustrative manual SPF recorddns
TXT em123 v=spf1 include:sendgrid.net ~all
Run the SPF check after DNS propagation. Test the Return-Path subdomain when SendGrid uses Automated Security, and test the exact TXT host shown by SendGrid for manual setup. SPF evaluation permits at most 10 DNS-querying mechanisms and modifiers, including nested includes; exceeding that limit returns permerror.

SPF checker

Find SPF syntax issues, lookup limits, and weak records.

?/16tests passed
If SPF passes but DMARC fails, compare the envelope MAIL FROM domain with the visible From domain under the policy's matching mode. DKIM can independently satisfy DMARC when its passing signing domain matches the From domain.

Set up DKIM

Domain Authentication makes SendGrid sign with your own DKIM domain. With Automated Security, publish two DKIM CNAME records, commonly under s1._domainkey and s2._domainkey.
SendGrid s1 and s2 DKIM CNAME records on the Install DNS Records screen.
SendGrid s1 and s2 DKIM CNAME records on the Install DNS Records screen.
  1. Copy selectors: Add both DKIM CNAME records exactly as SendGrid displays them.
  2. Keep both: SendGrid publishes two selectors and activates one at a time, which lets it rotate DKIM keys when needed.
  3. Avoid conflicts: Use a custom DKIM selector when the same domain is authenticated in another SendGrid account or subuser, or when another DNS record already uses the default selector.
  4. Send a real message and check that the DKIM d= domain matches the visible From domain under adkim. Strict mode requires an exact match; relaxed mode accepts domains with the same organizational domain.
DKIM CNAME examplesdns
CNAME s1._domainkey s1.domainkey.u1234567.wl000.sendgrid.net CNAME s2._domainkey s2.domainkey.u1234567.wl000.sendgrid.net
With Automated Security off, publish the complete DKIM public key as the TXT record SendGrid supplies, commonly at m1._domainkey.example.com. Manual DKIM still requires an underscore in the hostname. SendGrid's DKIM documentation describes the automated and manual record formats.
Why DKIM matters for forwarding
SPF breaks more often with forwarding because SPF checks the connecting server. DKIM survives forwarding when the message body and signed headers stay unchanged, so get DKIM passing consistently before enforcement.

Set up DMARC

Publish DMARC as a TXT record in your DNS. SendGrid can show a starter record during setup, and the SendGrid DMARC docs cover the policy format. Generate the record deliberately with the DMARC generator so the reporting address and requested policy are explicit. Preserve a valid existing record instead of adding SendGrid's starter record alongside it.
Recommended starter DMARC recorddns
v=DMARC1; p=none; rua=mailto:dmarc@example.com
  1. If your domain has no DMARC policy, publish the starter record at _dmarc.example.com, replacing example.com with your domain. In DNS panels that append the domain, enter only _dmarc.
  2. Keep enforcement: If you are already on quarantine or reject and SendGrid passes, keep that policy.
  3. Replace dmarc@example.com with a working report mailbox. For Suped reporting, copy the reporting address supplied for your domain. External report destinations require DNS authorization from the receiving domain, normally handled by the reporting provider.
  4. Avoid duplicates: Keep one DMARC TXT record at _dmarc; multiple records make DMARC fail.
  5. Use relaxed mode: Leave aspf and adkim omitted or set to r unless an exact same-host match is required.
DMARC pass rule
DMARC passes when SPF or DKIM passes and the passing domain matches the visible From domain under the selected mode. SendGrid can satisfy SPF through the Return-Path domain and DKIM through the d= signing domain.
For a From domain of example.com and a Return-Path domain of em123.example.com, relaxed SPF domain matching passes and strict SPF domain matching fails. Passing DKIM with d=example.com still satisfies DMARC, including strict DKIM mode.
For a From address at news.example.com, check _dmarc.news.example.com and the inherited organizational-domain policy. An explicit subdomain policy takes precedence over the inherited policy; publish a separate record only when that policy or reporting destination needs to differ.
After publishing the record, check the public DNS result. The checker should show one DMARC record, a valid v=DMARC1 tag, and the policy you intended.

DMARC checker

Look up a domain's DMARC record and catch policy issues.

?/7tests passed
If the DNS record is valid but reports still show failures, move to message-header checks. DNS validity only proves the policy exists; it does not prove SendGrid traffic is passing.

Check the sending account and From domain

A verified domain must be available to the account or subuser that sends the message. Check which account owns the API key or SMTP credentials used by your application. For subuser sending, authenticate the domain for that subuser or assign the parent account's verified domain to it.
SendGrid selects a matching authenticated domain for the visible From address, then uses its fallback settings when there is no match. Subuser defaults take precedence over parent-assigned domains. If no usable authenticated domain is found, SendGrid uses sendgrid.net. If both fallback authentication domains are unrelated to your From domain, DMARC fails even when raw SPF and DKIM pass. SendGrid's domain-selection guidance explains the selection order.

Verify SendGrid DNS and message headers

Verification needs both SendGrid status and a real message header. SendGrid checks published DNS records, while mailbox providers evaluate authentication on each received message. A successful Domain Authentication status does not guarantee a DMARC pass for the mail your application sends.
SendGrid Domain Authentication marked Verified after DNS record checks.
SendGrid Domain Authentication marked Verified after DNS record checks.
  1. Open Sender Authentication and confirm the generated SPF and DKIM records are verified. Check the DMARC record separately, even when the domain status is successful.
  2. Send real mail: Send from the exact From domain your app uses, not a single-sender test identity on another domain.
  3. Read the receiving server's Authentication-Results header for spf=pass, dkim=pass, and dmarc=pass. Compare smtp.mailfrom and DKIM header.d with the visible From domain, rather than checking pass labels alone.
  4. If SendGrid fails verification, check for a duplicated root domain in the DNS host field. In Cloudflare, set the authentication CNAMEs to DNS only so their targets remain publicly visible; SendGrid's DNS validation guidance describes this check.
  5. With aspf=s, the envelope MAIL FROM domain must exactly match the visible From domain. A custom Return-Path label does not guarantee this. Keep matching DKIM passing, or use relaxed SPF mode when your policy permits it.

Symptom

Common cause

Next check

SPF fail
Bounce-domain SPF error or unauthorized sending IP
Check the MAIL FROM host and SPF lookup limit
DKIM fail
Missing selector record or modified signed content
Check the s= selector and its CNAME or manual TXT
DMARC fail
Neither passing authentication domain matches From
Compare From with smtp.mailfrom and header.d
Unverified
DNS cache or record mismatch
Check public records; allow up to 48 hours for validation
Header symptoms and fixes for SendGrid authentication.
Send a real message to Suped's email tester to inspect its authentication results and DNS checks. Passing authentication does not guarantee inbox placement; receiving providers apply their own filtering rules.

Email tester

Send a real email to this address. Suped shows a results button when the test is ready.

?/43tests passed
If headers show SendGrid DKIM passing but DMARC failing, read the SendGrid failure guide and compare the visible From domain with the DKIM signing domain and Return-Path domain.

Monitor SendGrid authentication failures

SendGrid verification tells you the setup worked at one point. Suped's DMARC monitoring uses aggregate reports to identify SendGrid authentication failures after DNS edits or sending changes. These reports arrive in batches, so they do not provide an immediate result for each message.
Notification settings page with DMARC alerts, weekly summary, toggles, and preview buttons
Notification settings page with DMARC alerts, weekly summary, toggles, and preview buttons
  1. Watch reports: Suped ingests DMARC aggregate XML and shows which sources pass SPF, DKIM, and DMARC.
  2. Use Suped alerts to investigate new SendGrid failures as aggregate reports arrive after DNS edits or selector changes.
  3. Track reputation: Suped shows blocklist (blacklist) monitoring beside authentication so IP and domain issues are seen together.
  4. Give fixes: Suped groups issues by source and gives steps to fix the exact DNS or SendGrid setting.
Example SendGrid pass-rate thresholds
Illustrative thresholds for identified legitimate SendGrid traffic, not DMARC requirements or Suped defaults. Review failures by source and volume before enforcement.
Healthy
99%+ DMARC pass
Investigate legitimate failures even when the overall pass rate is high.
Investigate
95% to under 99% pass
Review affected sending sources and recent configuration changes.
Act now
Under 95% pass
Legitimate traffic is failing at volume.
How Suped fits this workflow
Suped's DMARC platform turns aggregate XML reports into results by sending source. Use its SendGrid results to identify failing traffic and check the corresponding DNS or account setting before changing policy.

Secure your domain with p=reject

The goal is p=reject, but only after SendGrid and every other legitimate sender passes DMARC. Suped's Hosted DMARC helps stage policy changes without repeated DNS edits.
Hosted DMARC configuration dialog showing policy controls, CNAME setup, and expanded advanced options
  1. Baseline traffic: Stay at p=none until reports cover your normal sending schedule, including infrequent campaigns, and every legitimate source passes consistently.
  2. Move by policy: Change to p=quarantine after legitimate sources pass, then move to p=reject after reviewing the resulting reports.
  3. Before p=reject, identify unknown sources that appear legitimate and fix their authentication. Unauthorized spoofed traffic should fail; do not add it to SPF or configure DKIM for it.
  4. At the organizational domain, p=reject also applies to subdomains unless an applicable policy overrides it. Use sp for a different existing-subdomain policy and np for a different non-existent-subdomain policy; review explicit subdomain records separately.
  5. Keep alerts: Leave Suped alerts on after reject because DNS, vendor settings, and mail routing change over time.
Do not stage with pct
RFC 9989 marks the pct tag historic. Do not depend on percentage sampling for enforcement staging. Collect aggregate reports at p=none, correct legitimate sources, then apply quarantine or reject when the domain is ready. Receivers retain local discretion over message handling.
Quarantine recorddns
v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com
Reject recorddns
v=DMARC1; p=reject; rua=mailto:dmarc@example.com
Before reject
  1. Known senders: SendGrid and all other sources appear in reports.
  2. Pass status: Legitimate sources pass DMARC consistently.
  3. Unknown sources that look legitimate are investigated; confirmed spoofing remains unauthorized.
After reject
  1. Policy state: Receivers are instructed to reject failing mail.
  2. Monitoring state: Suped keeps watching SendGrid and other sources.
  3. Change process: New senders are added and verified before production use.

FAQ

SendGrid requires a verified sender identity. Domain Authentication configures SPF and DKIM for your domain, while DMARC is a separate DNS policy; a DMARC pass is not required for SendGrid to mark Domain Authentication successful. Receiving providers apply their own sender requirements. DMARC passes when SPF or DKIM passes with a domain that matches the visible From domain.

Only when SendGrid's manual setup tells you to publish it at that host. With Automated Security on, SendGrid uses CNAME records and manages SPF for the Return-Path subdomain.

Twilio advises allowing up to 48 hours for DNS validation. Check that the records are public, the hostname does not repeat your domain, and authentication CNAMEs are not proxied. Return to Sender Authentication and click Verify; contact SendGrid support if correct public records still fail validation after that window.

Single Sender Verification confirms ownership of one email address; it does not configure your domain's SPF or DKIM. Authenticate a domain you control for production sending. A gmail.com or yahoo.com address cannot use your domain's authentication to satisfy that provider's DMARC policy.

Raw SPF or DKIM pass is not enough. DMARC also checks whether the passing domain matches the visible From domain. The SendGrid failure guide covers this case in more detail.
DMARC monitoring

Start monitoring your DMARC reports today

Suped DMARC platform dashboard
What you'll get with Suped
Real-time DMARC report monitoring and analysis
Automated alerts for authentication failures
Clear recommendations to improve email deliverability
Protection against phishing and domain spoofing