DNS · SendGrid on Cloudflare

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.

  1. Get the records from SendGrid. Settings, Sender Authentication, Authenticate Your Domain. The numbers in em1234 and u1234567 are unique to your account.
  2. 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.
  3. Open the DNS panel at Cloudflare. Dashboard, your domain, DNS, Records, Add record.
  4. 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.
  5. 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.

TypeName fieldValue
CNAMEem1234u1234567.wl123.sendgrid.net
CNAMEs1._domainkeys1.domainkey.u1234567.wl123.sendgrid.net
CNAMEs2._domainkeys2.domainkey.u1234567.wl123.sendgrid.net
TXT_dmarcv=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