Back to Blog
Compliance & Deliverability

How to Set Up SPF, DKIM, and DMARC for SendGrid

SPF, DKIM, and DMARC are the three authentication layers that protect your sending domain and improve deliverability. Without them, your SendGrid emails land in spam and your domain is open to spoofing.

DA
Danial A
Senior Twilio Consultant, Telphi Consulting
June 20, 2026
8 min read
Twilio
Compliance
Deliverability
How to Set Up SPF, DKIM, and DMARC for SendGrid

SPF, DKIM, and DMARC are three complementary DNS-based email authentication standards that work together to verify that email messages claiming to come from your domain were actually authorized by you to send through a specific mail server. For SendGrid senders, implementing all three is not optional; major inbox providers including Gmail and Microsoft have significantly increased spam filtering for unauthenticated senders, and Google's 2024 sender requirements made DMARC authentication mandatory for senders dispatching more than 5,000 messages per day to Gmail accounts. Setting up all three for your SendGrid account typically takes under two hours but requires DNS access to your domain and careful attention to record formatting.

Setting Up SPF for SendGrid

SPF, or Sender Policy Framework, is a DNS TXT record on your domain that lists the mail servers authorized to send email from your domain. For SendGrid, the SPF record must include SendGrid's sending infrastructure so that receiving mail servers recognize SendGrid as an authorized sender for your domain. The SendGrid-specific SPF include directive is include:sendgrid.net, and your full SPF record should look like: v=spf1 include:sendgrid.net ~all. If you have other legitimate sending systems such as your own mail server or a CRM email sender, add those include directives before the ~all mechanism. You can have only one SPF TXT record per domain; multiple SPF records cause SPF failures, so if an SPF record already exists for your domain, edit it to add the SendGrid include rather than creating a new one. After publishing the record, use an SPF checking tool to verify the record resolves correctly and includes SendGrid's ranges.

Configuring DKIM via SendGrid Domain Authentication

DKIM, or DomainKeys Identified Mail, adds a cryptographic signature to your outgoing emails that receiving servers use to verify that the message content was not altered in transit and that the sending domain authorized the message. SendGrid implements DKIM through its Domain Authentication feature, which generates a unique DKIM keypair for your account and requires you to add two CNAME records to your domain DNS. The CNAME records have a format similar to s1._domainkey.yourdomain.com pointing to s1.domainkey.yoursubdomain.sendgrid.net, with the exact values provided by SendGrid in the Sender Authentication section of the console. CNAME records are used rather than TXT records because they allow SendGrid to rotate the underlying DKIM keys without requiring you to update your DNS records each time. After adding the CNAME records, click Verify in the SendGrid console; verification typically propagates within a few minutes to an hour depending on your DNS TTL settings.

Implementing DMARC for Policy Enforcement

DMARC, or Domain-based Message Authentication Reporting and Conformance, builds on SPF and DKIM by allowing you to specify a policy for receiving mail servers to follow when messages fail authentication. DMARC is published as a TXT record at the address _dmarc.yourdomain.com. A starting DMARC record looks like: v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com. The p=none policy means receiving servers take no action on failing messages but do send aggregate reports to your rua address. After reviewing those reports for 30 days to understand your email sending ecosystem, advance to p=quarantine, which routes failing messages to spam folders, and then to p=reject, which instructs receiving servers to refuse failing messages entirely. Moving too quickly to p=reject without understanding all legitimate sending sources often blocks legitimate email from CRM tools or marketing platforms that were not yet authenticated. Analyze your DMARC reports carefully before advancing your policy.

Testing and Ongoing Monitoring

After publishing your SPF, DKIM, and DMARC records, test the complete authentication chain by sending a test email from your SendGrid account to a Gmail or Microsoft 365 address and examining the original message headers for the Authentication-Results header. This header shows whether SPF passed or failed, whether DKIM passed or failed, and whether DMARC passed or failed. All three should show pass for a correctly configured domain. DMARC aggregate reports delivered to your rua address are XML files that can be parsed with free tools to show you which sources are sending email claiming to be from your domain and whether those messages are passing authentication. Set a calendar reminder to review DMARC reports at least monthly, as new sending systems are often added to your organization without updating SPF records, which causes deliverability failures that look like spam filtering problems but are actually authentication misconfigurations.

Conclusion

SPF, DKIM, and DMARC authentication is the technical foundation of email deliverability and domain protection, and the configuration is precise enough that a single missed step results in authentication failures that affect every email you send. Speak with our compliance team and we will implement and verify your complete email authentication setup for SendGrid.

Share this article:
0 views

Ready to Transform Your Business Communications?

Get a free consultation with our VoIP experts and discover how we can help you save costs, improve efficiency, and scale your business.

Comments (0)

Join the discussion and share your thoughts (AI-moderated for quality)

Protected by AI moderation

Be the first to comment

No comments yet. Share your thoughts below.