Introduction
SendGrid passes DMARC for a client domain once you complete Domain Authentication: SendGrid then signs mail with DKIM for the client's own domain (selectors s1 and s2) and uses a return path subdomain of that domain. Without it, SendGrid falls back to sendgrid.net, which never aligns with the client's From address.
This guide covers the records Twilio SendGrid generates, automated security, return path alignment, link branding, subusers and a troubleshooting table for MSPs. For the protocol background, see the DMARC guide.
Key takeaways
- With automated security on (the default), you publish CNAME records: one for the return path subdomain and two DKIM records at
s1._domainkeyands2._domainkey. SendGrid then manages SPF, the DKIM keys and key rotation. - DMARC normally passes through aligned DKIM (
d=is the client domain). SPF aligns under relaxed alignment because the return path is a subdomain such asem1234.example.com, but not under strictaspf=s. - If SendGrid cannot match the From address to a valid authenticated domain, it uses
sendgrid.net, and DMARC fails. - Each account or subuser sending for a domain needs it authenticated; a second account on the same domain needs a custom DKIM selector.
How does SendGrid authenticate a client domain?
Through Domain Authentication. In the SendGrid app go to Settings > Sender Authentication and choose Get Started in the Domain Authentication section. SendGrid generates DNS records for the client's domain, you publish them, and you verify them in the same screen. The steps, per Twilio's domain authentication documentation:
- Select the client's DNS host and enter the root domain the client sends From (for example
example.com). - Decide on the Advanced Settings: automated security, custom return path, custom DKIM selector, and EU pinning if the account sends through SendGrid's EU region.
- Optionally set up link branding in the same flow.
- Publish the generated records at the client's DNS host.
- Click Verify. Twilio advises allowing up to 48 hours for DNS changes to propagate.
Settle the Advanced Settings first: SendGrid's support notes that a custom return path cannot be added to an existing domain authentication afterwards.
Which DNS records does SendGrid generate?
With automated security on, SendGrid generates three CNAME records: one for the return path subdomain and two for DKIM. The screen can also show link branding CNAMEs and a DMARC TXT record. Values are unique per account, so copy them from SendGrid.
The shape of the records, using the example values from SendGrid's Authenticate a domain API reference:
em1234.example.com. CNAME u1446226.wl.sendgrid.net.
s1._domainkey.example.com. CNAME s1.domainkey.u1446226.wl.sendgrid.net.
s2._domainkey.example.com. CNAME s2.domainkey.u1446226.wl.sendgrid.net.
The first record is the return path (bounce) subdomain, with a label SendGrid generates. The two _domainkey records point the DKIM selectors at keys SendGrid hosts.
What changes when automated security is off?
Automated security decides who maintains the SPF and DKIM data. When it is on, SendGrid manages your SPF records, DKIM keys and DKIM key rotation behind the CNAMEs. When it is off, SendGrid gives you two TXT records (SPF and DKIM) and one MX record to publish, and future key changes become your job.
Twilio suggests turning it off when a DNS provider does not accept underscores in CNAME records. For an MSP, leaving it on avoids per-client key rotation. In manual mode, SendGrid's troubleshooting guide shows the SPF value v=spf1 include:sendgrid.net ~all and a DKIM TXT record at a selector such as m1._domainkey.
Do you need to add sendgrid.net to the client's SPF record?
Not for DMARC. SPF (RFC 7208) is evaluated against the return path domain, not the From domain. With Domain Authentication the return path is the em subdomain, so the root SPF record is not consulted, and adding include:sendgrid.net there only spends one of SPF's ten DNS lookups (see SPF too many DNS lookups).
Why does SPF alignment fail with SendGrid?
SPF alignment fails in two situations. Either the domain is not authenticated, so the return path is a sendgrid.net address that can never align, or the client's DMARC record uses strict SPF alignment (aspf=s), which requires the return path domain to match the From domain exactly. A subdomain such as em1234.example.com only aligns under relaxed alignment.
Relaxed alignment is the default in RFC 9989, which obsoleted RFC 7489: em1234.example.com and example.com share an organizational domain, so SPF aligns. SendGrid's support links strict SPF alignment to 550 5.7.26 DMARC rejections and recommends avoiding aspf=s in most cases. See the alignment guide.
What does a custom return path change?
A custom return path replaces SendGrid's generated label with one you choose, for example bounces.example.com instead of em1234.example.com. It is still a subdomain CNAME to SendGrid, so it does not fix strict SPF alignment. Its value is a predictable label across clients. SendGrid warns that an existing CNAME with the same name gets overwritten, so check the zone first.
How does DMARC pass for SendGrid mail?
DMARC passes when either SPF or DKIM passes for a domain aligned with the From address. For authenticated SendGrid mail, DKIM is the reliable route: the signature carries d=example.com and s=s1 or s=s2, which aligns with a From address at example.com under both relaxed and strict DKIM alignment. Aligned DKIM also survives most forwarding, where SPF breaks.
If you see d=sendgrid.net instead, the From domain did not match a valid authenticated domain in the sending account. Twilio's sender authentication troubleshooting guide states that when no valid authenticated domain matches, mail defaults to sendgrid.net. You can check a real message with the email header analyzer and the published keys with the DKIM validator.
Do you need link branding for DMARC?
No. Link branding rewrites click-tracking, open-tracking and image links from sendgrid.net (or eu.sendgrid.net) to a subdomain of the client's domain. It does not change SPF, DKIM or DMARC results, but receivers judge the links in a message, so it is still worth doing.
Set it up under Settings > Sender Authentication > Brand Your Links, or during Domain Authentication. Twilio's link branding documentation describes two pairs of CNAME records (example hostnames url1234.example.com and 1234567.example.com) and requires the branded domain to match the From domain.
How do subusers and multiple client domains work?
Each SendGrid subuser sends with the domain authentications assigned to it. The parent account can authenticate a domain on a subuser's behalf (the API's username parameter), and Twilio allows each subuser up to 3,000 authenticated domains and 3,000 link brandings. One subuser per client keeps records and reputation separate. Practical rules:
- One authentication per From domain. A client sending as
example.comandexample.co.ukneeds both domains authenticated. - Second account, same domain: if a domain is already authenticated in one SendGrid account or subuser, use a custom DKIM selector for the second one. Otherwise both try to publish
s1._domainkeyands2._domainkey. SendGrid's examples use short selectors such asorgor001. - Document each client's SendGrid account, selector and return path label, so offboarding does not leave orphaned CNAMEs.
When does reverse DNS matter?
Only for dedicated IPs. Twilio states that reverse DNS can be set up only if you have a dedicated IP, and only by the parent account. It uses an A record under the client's domain (Twilio's example is o1.test.yourdomain.example.com). Reverse DNS is not part of DMARC; see reverse DNS and email authentication for what it does and does not affect.
How do you troubleshoot SendGrid DMARC failures?
Start from the aggregate reports: find the failing SendGrid sources, then compare the d= and envelope domains with the client's From domain. Most failures trace back to one of these causes.
| Symptom | Likely cause | Fix |
|---|---|---|
DKIM passes with d=sendgrid.net, DMARC fails |
From domain not authenticated in the sending account or subuser | Authenticate the domain there, or assign the existing authentication to that subuser |
| SPF passes but is not aligned | Domain not authenticated, so the return path is on sendgrid.net |
Complete Domain Authentication |
SPF passes on em1234.example.com but is reported unaligned |
DMARC record uses aspf=s |
Use relaxed SPF alignment; DKIM still aligns either way |
| Verification fails, records look correct | DNS host appended the domain (em1234.example.com.example.com) |
Enter only the host label, or a fully qualified name with a trailing dot |
| Verification fails on one record | An existing MX, TXT or CNAME at the same name conflicts | Remove the duplicate record |
| CNAME cannot be saved | DNS host rejects underscores in CNAME names | Turn automated security off and use the TXT/MX records |
Second account conflicts on s1._domainkey |
Same domain authenticated twice with default selectors | Use a custom DKIM selector |
The DNS lookup tool resolves each CNAME, and why does DMARC fail when SPF passes covers the general patterns.
How does this fit into an MSP's DMARC rollout?
Treat SendGrid as one source in your third-party sender process. Authenticate it at p=none, confirm in aggregate reports that its traffic passes with aligned DKIM, then move to p=quarantine and p=reject. DMARC AI parses each client's aggregate reports in one multi-tenant view, so an unaligned subuser shows up before enforcement. The UK NCSC's email security and anti-spoofing guidance also starts at a policy of none. Compare the Amazon SES guide and the Mailgun DMARC guide.
FAQ
Does SendGrid sign with DKIM by default?
Yes, but without Domain Authentication the signature uses sendgrid.net, which does not align with the client's From domain, so DMARC cannot pass on it. After Domain Authentication, SendGrid signs with the client's domain using the s1 or s2 selector, or a custom selector, and DKIM alignment passes.
Does SendGrid create a DMARC record for me?
No. The setup screen can show a DMARC TXT record to add if the domain has none, and Twilio notes that a DMARC pass is not required for SendGrid's own sender authentication to verify. Publishing and managing the policy is your job; the DMARC generator builds a starting record at p=none.
Can two SendGrid accounts send for the same domain?
Yes. Authenticate the domain in the first account with the default selectors, then use the custom DKIM selector option in the second account or subuser. Each account then publishes its own DKIM CNAMEs, and both sign aligned mail for the same domain without overwriting each other.
Should I use strict alignment for SendGrid?
Strict DKIM alignment works, because SendGrid signs with the exact From domain. Strict SPF alignment does not, because the return path is a subdomain. SendGrid recommends avoiding aspf=s in most cases. Relaxed alignment for both is the RFC 9989 default and fits almost every client.
Final thoughts
SendGrid and DMARC work well together once every From domain is authenticated in every account that sends it. Leave automated security on, rely on aligned DKIM, keep SPF alignment relaxed, and confirm in aggregate reports before enforcing.