How to set up DKIM, DMARC, SPF for Google Workspace

Many businesses find that their emails to customers don’t land in the primary inbox, often because DKIM, DMARC and SPF are set up incorrectly or skipped entirely. If your business uses Google Workspace, you should follow Google’s guidelines to make your emails more trustworthy. In this article, I’ll show you how to set up DKIM, DMARC and SPF for Google Workspace carefully, step by step. Let’s get started.

Why do we need DKIM, DMARC, and SPF?

I’ll explain this in simple terms, because technical jargon can be confusing if you’re new to this topic.

  • DKIM: Helps Google verify whether your email is spoofed or actually authorized by the domain owner.
  • DMARC: An email authentication protocol that protects your domain from unauthorized use and email spoofing.
  • SPF: Helps Google block spam and detect whether the sender’s address is real or fake.

DKIM, DMARC and SPF help your outgoing emails reach the primary inbox. I talked to Google Workspace support, and they told me that setting up DKIM correctly helps reduce the number of emails that end up in spam.

Setting up DKIM, DMARC, and SPF correctly will help reduce spam rates
Setting up DKIM, DMARC, and SPF correctly will help reduce spam rates

How to check a domain's DKIM, DMARC and SPF

Go to the MX Check page to check if you have set up DKIM, DMARC, and SPF correctly. Paste your domain into the Domain name box and click Run test.

For example, lucidgen.com had yellow warnings for DKIM and DMARC, which meant DKIM and DMARC for Google Workspace weren’t set up correctly. Try running the test with your own domain to see the results.

How to check a domain's DKIM, DMARC and SPF
How to check a domain’s DKIM, DMARC and SPF

After I fixed the DKIM and DMARC settings, the warnings disappeared and every check for lucidgen.com turned green. I’ll show you how to set up DKIM and DMARC right below.

All checks pass after setting up lucidgen.com correctly
All checks pass after setting up lucidgen.com correctly

Note: If you see a domain with many errors in the MX check that still gets its emails into the primary inbox, it probably doesn’t use Google Workspace. For example, a domain that uses Outlook will be set up according to Outlook’s requirements.

Set up DKIM, DMARC and SPF for Google Workspace

Video tutorial for setting up DKIM, DMARC, SPF for Google Workspace

Set up DKIM for Google Workspace

To set up DKIM for Google Workspace, you need to use a super admin account in your (or your company’s) Google Workspace.

Step 1: Go to admin.google.com > search for DKIM in the search bar > click DKIM authentication.

Open DKIM authentication in the Google Workspace Admin console
Open DKIM authentication in the Google Workspace Admin console

Step 2: Click Generate new record > select the DKIM key length > click Generate.

  • 1024-bit DKIM key: Compatible with more older email systems. Suitable for DNS providers that only accept values up to 255 characters. It’s the most widely used option, so for now I suggest choosing it.
  • 2048-bit DKIM key: More secure and compatible with popular email systems such as Gmail and Outlook. Suitable for DNS providers that accept values longer than 255 characters. This is where things are heading.
Click Generate new record to create a new DKIM record
Click Generate new record to create a new DKIM record

Step 3: Copy the host name (google._domainkey) and the DKIM value to add to your DNS.

Copy the DKIM key to add to your DNS
Copy the DKIM key to add to your DNS

Step 4: Go to your domain management page > DNS settings > add the DKIM record as follows.

NameTypeTTLData
google._domainkeyTXT1hYour DKIM key
Set up DKIM for Google Workspace in DNS
Set up DKIM for Google Workspace in DNS

After you add the DKIM record to your DNS, Google says you need to wait up to 48 hours for it to take effect. It depends on your domain provider, but in my case it took about 30 minutes.

Wait from 30 minutes to 48 hours for the DKIM setup to take effect
Wait from 30 minutes to 48 hours for the DKIM setup to take effect

Step 5: After waiting 30 minutes to 48 hours, go back to the DKIM authentication page > click Start Authentication to verify that your domain has Google Workspace’s DKIM.

Click Start Authentication to verify DKIM for your domain
Click Start Authentication to verify DKIM for your domain

When the status changes to “Authenticating email”, the verification is successful.

The Authenticating email status means DKIM is verified
The Authenticating email status means DKIM is verified

If the verification fails and you get a message like the one below, wait the full 48 hours and click Start Authentication again.

Email authentication was not verified. Please allow 48 hours for DNS to update and make sure you entered the correct TXT record into your domain provider’s DNS settings page.

Error message when verifying DKIM

Set up DMARC for Google Workspace

Google suggests three common DMARC setups. Choose only one of them to add to your DNS.

NameTypeTTLDataExplanation
_dmarcTXT1hv=DMARC1; p=none; rua=mailto:reports@yourdomain.comWhen a message fails authentication > Do nothing and deliver it to the recipient. Everything is logged and reported to you.
_dmarcTXT1hv=DMARC1; p=reject; rua=mailto:reports@yourdomain.comWhen a message fails authentication > Don’t deliver it and return it to the sender. You get a report.
_dmarcTXT1hv=DMARC1; p=quarantine; rua=mailto:reports@yourdomain.comWhen a message fails authentication > Mark it as spam and deliver it to the recipient’s spam folder. You get a report.

I recommend starting with the first option (p=none) and watching the reports sent to your email for about 1 to 2 weeks. If any service sends mail on behalf of your domain (an email marketing tool, a CRM, your website…) and its SPF or DKIM isn’t set up correctly yet, jumping straight to p=reject would block those legitimate messages too. Once the reports show that your legitimate mail passes authentication, move to p=quarantine, and only then to p=reject for tight control over messages that fail authentication. This also follows Google’s recommended DMARC rollout.

Set up DMARC for Google Workspace
Set up DMARC for Google Workspace

Set up SPF for Google Workspace

Setting up SPF for Google Workspace is quite simple, with no options to choose from. Just add this TXT record to your DNS and you’re done.

NameTypeTTLData
@TXT1hv=spf1 include:_spf.google.com ~all

Note: An earlier version of this article also told you to add a record of type SPF (the screenshot below still shows that old setup). That record type has been discontinued under RFC 7208, so SPF should now be published as a TXT record only. If your domain already has a record starting with v=spf1, add include:_spf.google.com to that record instead of creating a second one, because a domain should have exactly one SPF record.

Set up SPF for Google Workspace
Set up SPF for Google Workspace

Conclusion

After setting up DKIM, DMARC and SPF, go back to Google’s Check MX page to see whether everything shows as valid. Feel free to share your results or questions in the comments below. Good luck!

Hieu Tran Ngoc Minh

Hieu (born in 1996) holds a Bachelor's degree in Business Administration from Saigon Technology University. Currently a Data Analyst at Ninja Van, Hieu has extensive experience in Data Analysis and Digital Marketing. This blog is where Hieu shares practical experiences from work and life.

Leave a Comment

Feel free to leave your comment (preferably in English), and we will review and respond as soon as possible. Please use a real email to ensure your comment is approved and to receive notifications when we reply. You can also add an avatar to your email.