Back to dashboard

SendGrid: authenticate your domain

What this guide is for

SendGrid (Twilio) sends your emails from its servers. Domain authentication lets SendGrid sign your messages with DKIM for your domain and use a subdomain of yours as the return-path, which also aligns SPF.

Expected records

With Automated Security (on by default), SendGrid provides three CNAME records:

Type Name (host) Value
CNAME em1234 (return-path subdomain) u1234567.wl.sendgrid.net
CNAME s1._domainkey s1.domainkey.u1234567.wl.sendgrid.net
CNAME s2._domainkey s2.domainkey.u1234567.wl.sendgrid.net
TXT (DMARC) _dmarc v=DMARC1; p=none; rua=mailto:[email protected]
  • The numbers (em1234, u1234567) are specific to your account: copy the values shown by SendGrid.
  • The return-path subdomain CNAME handles SPF: no include needs to be added to your root domain's SPF record in this mode.
  • If Automated Security is turned off, SendGrid provides MX and TXT records instead. DKIM names always contain an underscore (_domainkey).

Steps in SendGrid

  1. In the SendGrid console, open Settings > Sender Authentication.
  2. Start domain authentication (Authenticate Your Domain), choose your DNS host and enter the domain you send from.
  3. Leave Automated Security checked, unless your host rejects underscores in CNAME records.
  4. On the Install DNS Records page, copy the three CNAME records to your DNS host.
  5. Return to SendGrid and click Verify. DNS propagation can take up to 48 hours.

Precautions:

  • If your host automatically appends the domain, enter the relative name (em1234, s1._domainkey) to avoid em1234.example.com.example.com.
  • Before adding the CNAME records, check that no record already exists under the same names.

Check the setup

  1. In Sender Authentication, the domain should show as verified.
  2. Check a CNAME from the command line: dig cname s1._domainkey.example.com should return a target under sendgrid.net.
  3. Send a test email to Gmail and check for DKIM: PASS with your domain.
  4. Run a new scan in this tool: the s1 and s2 selectors should be detected.

DMARC

Publish a single TXT record at _dmarc.<your domain>, starting with monitoring:

v=DMARC1; p=none; rua=mailto:[email protected]

Read the reports for a few weeks, check that all your legitimate mail passes, then move gradually to p=quarantine and p=reject.

Official documentation

SendGrid: setup guide - SEKOIA