How to Set Up DKIM for Gmail
Set up DKIM for Gmail accounts, including free Gmail and Google Workspace. Learn how to verify DKIM is working for your Gmail emails.
Last updated: 2026-04-27
"How do I set up DKIM (DomainKeys Identified Mail) for Gmail?" is one of the most common email authentication questions, and the answer depends entirely on which type of Gmail you use. A free @gmail.com account and a custom domain on Google Workspace handle DKIM in completely different ways. This guide covers both so you know exactly what applies to your situation.
Free Gmail (@gmail.com)
If you send email from an address like yourname@gmail.com, there is nothing for you to configure. Google handles DKIM automatically for all free Gmail accounts. You cannot change, disable, or customize it.
Every outgoing email from @gmail.com is signed with Google's own DKIM key using d=gmail.com. Recipients' mail servers verify the signature against Google's public key, and it passes without any action on your part.
Already using @gmail.com?
If you send from an @gmail.com address, DKIM is already set up and working. The rest of this guide is for people who use a custom domain (like yourname@yourdomain.com) through Google Workspace.
You cannot publish your own DKIM keys for gmail.com, and you cannot change the selector Google uses. This is entirely managed infrastructure. If you need control over DKIM signing (for example, to pass DMARC alignment with your own domain), you need Google Workspace with a custom domain.
Google Workspace (Custom Domain)
If you send email from yourname@yourdomain.com through Gmail via a Google Workspace subscription, you have full control over DKIM and you should absolutely configure it.
By default, Google Workspace may sign outgoing emails with a Google-managed key, but that key uses Google's domain rather than yours. For proper DMARC alignment, you need DKIM configured specifically for your domain so the signature's d= tag matches your From address.
Key Setup Details
- The default selector for Google Workspace DKIM is
google - Google recommends 2048-bit keys for stronger security
- You generate the key in the Google Admin Console and publish a TXT record to your DNS
We have a complete walkthrough covering every step of the process: How to Set Up DKIM in Google Workspace. That guide covers key generation, DNS record creation, enabling signing, and verification.
The short version:
- Open the Google Admin Console and navigate to Apps, then Google Workspace, then Gmail, then Authenticate email
- Select your domain and generate a new DKIM key (choose 2048-bit)
- Copy the TXT record Google provides
- Add the TXT record to your DNS at
google._domainkey.yourdomain.com - Return to the Admin Console and click Start Authentication
- Verify with a DKIM check
Checking Gmail DKIM
Whether you use free Gmail or Google Workspace, you can verify DKIM is working by looking up the record with our free DKIM test tool.
For Google Workspace, look up google._domainkey.yourdomain.com. If the record exists and contains a valid public key, your DNS side is correctly configured.
How to Verify DKIM in Gmail Headers
The best way to confirm DKIM is working end-to-end is to inspect actual email headers.
Send a test email
From your Gmail account, send a message to an external email address you control. Ideally use a non-Gmail address so you see the full authentication results.
Open the original message
In the receiving email client, view the message source or headers. In Gmail, click the three dots next to the reply button and select Show original.
Find the DKIM-Signature header
Search for DKIM-Signature in the raw headers. You will see something like:
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=yourdomain.com; s=google; t=1709251200;
h=from:to:subject:date:message-id;
bh=abc123...;
b=xyz789...
Check the d= value. For Google Workspace, it should show your domain. For free Gmail, it shows gmail.com.
Check the Authentication-Results
Look for the Authentication-Results header:
Authentication-Results: mx.example.com;
dkim=pass header.d=yourdomain.com header.s=google
A dkim=pass result confirms the signature verified successfully.
Gmail as a Sending Service
Some businesses use Gmail's SMTP servers to send email from applications, websites, or automated systems. If you configure an app to send through smtp.gmail.com using your Google Workspace credentials, those emails are signed with whatever DKIM configuration your Workspace domain has.
If DKIM is properly set up in Google Workspace, emails sent via SMTP relay will also be signed with your domain. If DKIM is not configured, they will be signed with Google's default key, which will not align with your custom domain for DMARC purposes.
For high-volume or transactional sending, consider a dedicated email service like SendGrid or Amazon SES instead of Gmail SMTP. Gmail has sending limits and is designed for person-to-person communication, not bulk or automated messages.
Troubleshooting Gmail DKIM
DKIM record not found: If a lookup for google._domainkey.yourdomain.com returns no results, the TXT record was not added to your DNS correctly. Double-check the record name and value in your DNS provider, and make sure you selected TXT as the record type.
Wrong selector: Google Workspace uses google as the default selector. If you chose a custom selector prefix during key generation, use that instead. The record will be at [prefix]._domainkey.yourdomain.com.
DKIM passes but DMARC fails: This is an alignment problem. Make sure the d= value in your DKIM signature matches your From address domain. If Gmail is signing with d=google.com rather than your domain, you have not completed the DKIM setup in the Admin Console. See our DKIM alignment guide for details.
DNS propagation delay: After adding the TXT record, it may take up to 48 hours to propagate globally, though most providers update within an hour. If verification fails, wait and try again.
Free Gmail vs Google Workspace DKIM
| Feature | Free Gmail (@gmail.com) | Google Workspace (Custom Domain) |
|---|---|---|
| DKIM signing | Automatic, managed by Google | Manual setup required |
| Signing domain (d=) | gmail.com | yourdomain.com |
| Selector | Google-managed | google (default) or custom |
| Key size | Google-managed | 1024-bit or 2048-bit (recommended) |
| DMARC alignment | Aligns with gmail.com only | Aligns with your custom domain |
| User configuration | None possible | Full control via Admin Console |
Complete Your Authentication
DKIM is one part of a three-layer email authentication strategy. For the best deliverability with Gmail, also configure:
- SPF (Sender Policy Framework): Ensure Google's servers are authorized senders for your domain. Check your SPF record at spfrecordcheck.com.
- DMARC (Domain-based Message Authentication, Reporting and Conformance): Set a policy that tells receiving servers how to handle authentication failures. Check yours at dmarcrecordchecker.com.
If you use additional sending services alongside Gmail (marketing platforms, CRMs, transactional email), each needs its own DKIM setup. Generate keys for those services at dkimcreator.com.
Related Articles
Never miss a DKIM issue
Monitor your SPF, DKIM, DMARC and MX records daily. Get alerts when something breaks.
Start Monitoring