Set up SendGrid DKIM and DNS records on Cloudflare
The exact name and value to enter at Cloudflare for each SendGrid record, with the mistakes that stop it verifying.
- Get the records from SendGrid. Settings, Sender Authentication, Authenticate Your Domain. The numbers in em1234 and u1234567 are unique to your account.
- Confirm Cloudflare hosts your DNS. Run dig +short NS yourdomain.com and expect: Two names ending in .ns.cloudflare.com. If you see something else, edits at Cloudflare have no effect.
- Open the DNS panel at Cloudflare. Dashboard, your domain, DNS, Records, Add record.
- Add each record. Enter only the part before your domain. Cloudflare appends the zone name. Set every one of these CNAMEs to DNS only (the grey cloud). A proxied CNAME answers with Cloudflare's own addresses instead of the target, and the lookup fails.
- Verify in SendGrid. SendGrid verifies when you click Verify; DNS changes can take up to 48 hours to be visible.
What to type at Cloudflare
Placeholders such as account numbers and tokens are illustrative. Use the values SendGrid shows you, with the name entered the way Cloudflare expects it.
| Type | Name field | Value |
|---|---|---|
| CNAME | em1234 | u1234567.wl123.sendgrid.net |
| CNAME | s1._domainkey | s1.domainkey.u1234567.wl123.sendgrid.net |
| CNAME | s2._domainkey | s2.domainkey.u1234567.wl123.sendgrid.net |
| TXT | _dmarc | v=DMARC1; p=none; |
Where it goes wrong on Cloudflare
- Enter only the part before your domain. Cloudflare appends the zone name.
- Set every one of these CNAMEs to DNS only (the grey cloud). A proxied CNAME answers with Cloudflare's own addresses instead of the target, and the lookup fails.
- TXT records cannot be proxied, so there is no cloud toggle on them.
- If Cloudflare Email Routing is on, the domain already has an SPF record of Cloudflare's. Merge into it; do not add a second.
Specific to SendGrid
- These are the records for automated security, which is on by default. SendGrid manages the SPF and DKIM values behind the CNAMEs, so you do not have to update them when its infrastructure changes.
- With automated security turned off, SendGrid gives you an MX record and TXT records instead of CNAMEs, and you maintain them yourself.
- SPF for SendGrid mail is checked on the em subdomain, not on your root domain. Your root SPF record does not need include:sendgrid.net when the CNAME is in place.
- SendGrid warns that some DNS hosts append your domain to whatever you type. Entering em1234.yourdomain.com can produce em1234.yourdomain.com.yourdomain.com; in that case enter only em1234.
Check it from the command line
Replace yourdomain.com and the placeholder names with your own. Each command should print the value you entered.
dig +short CNAME em1234.yourdomain.com dig +short CNAME s1._domainkey.yourdomain.com dig +short CNAME s2._domainkey.yourdomain.com dig +short TXT _dmarc.yourdomain.com
SendGrid record shapes read from its documentation on 11 November 2026. SendGrid on another host: GoDaddy · Namecheap · Amazon Route 53. Another platform on Cloudflare: Mailchimp · Klaviyo · Amazon SES · Instantly.
Check the records after you save
Look up the live DNS. This tool does not spend credits.
Related
- SendGrid DNS records: DKIM, SPF and DMARC setup
SendGrid domain authentication needs three CNAME records and one TXT record. Two CNAMEs (s1._domainkey and s2._domainkey) carry DKIM, one CNAME on a subdomain such as em1234 carries SPF through the Return-Path, and the TXT record at _dmarc is DMARC. You do not edit your root SPF record.
- Cloudflare DKIM record: setup steps and live check
How to add a DKIM record at Cloudflare: the exact host, value and menu path, then a free live lookup to confirm it published.
- SPF checker: validate an SPF record and count its DNS lookups
Check a domain's SPF record: one record or two, how it ends, and how many of the ten DNS lookups it uses.
- DMARC checker: read a domain's DMARC policy
Look up a DMARC record and see what the policy does, where reports go, and what weakens it.