Guide · Set up
SPF, DKIM and DMARC for Google Workspace
SPF, DKIM and DMARC are three DNS records that let receiving servers confirm that mail from a domain is genuine. For Google Workspace they are set in that order over about four days: SPF at once, DKIM after Gmail has been active for a day or more, DMARC two days after that.
- Time
- Twenty minutes of work, spread over about four days
- Who does it
- A super administrator with access to the domain's DNS
- Needed
- Gmail activated for the domain; a list of every service that sends mail in its name
Before starting
- Gmail is activated for the domain and the MX record points to Google.
- A list of every other service that sends mail in the domain's name: a newsletter tool, an invoicing system, the website's contact form.
- An address or a group that will receive the DMARC reports.
Without a Google Workspace account yet, the trial is the first step.
Sign-up is on Google's site.
Disclosure: the trial links are referral links. Getting Digital takes part in the Google Workspace referral programme; a business that signs up through one of them may earn Getting Digital a reward from Google, at no extra cost to the business. The assessment does not depend on it.
Mail can be sent with any sender address, which is what phishing relies on. The three records close that gap from the side of the domain's owner. SPF lists the servers that may send for the domain. DKIM adds a signature to each message that the receiving server checks against a key published in DNS. DMARC tells the receiving server what to do with a message that passes neither check, and sends the domain's owner reports.
Google requires senders of mail to personal Gmail accounts to have SPF or DKIM in place, and senders of more than 5,000 messages a day to have all three. Mail from a domain without them is more likely to be marked as spam.
Step 1: Add the SPF record
A domain has one SPF record, a TXT record on its root. For a domain that sends through Google Workspace only, the value below is complete. Every other sending service adds one include entry, taken from that service's documentation, before the final ~all; a record may hold up to ten of them. Nothing is set in the Admin console.
TXT record, host
@v=spf1 include:_spf.google.com ~allOnly one SPF record per domain; extend it, do not add a second.
Result: The headers of a message sent from Gmail to an outside mailbox show a pass for SPF.
Step 2: Generate the DKIM key and publish it
Google makes the key available 24 to 72 hours after Gmail is turned on for the organisation. In the Admin console the path is Apps, Google Workspace, Gmail, Authenticate email. There the domain is selected and Generate new record is clicked, with a key length of 2048 bits where the DNS host accepts it and the prefix selector google. The console shows the value of the TXT record, which begins with v=DKIM1 and contains the key.
TXT record, host
google._domainkeyv=DKIM1; k=rsa; p=(the key shown in the Admin console)The key is unique to the domain; copy it from the console.
Result: The record is saved at the DNS host. Signing is not active yet.
Step 3: Turn DKIM signing on
Google allows up to 48 hours for the new record to become visible. After that, the same page of the Admin console has the button Start authentication.
Result: The status at the top of the page changes to authenticating email with DKIM.
Step 4: Add the DMARC record in monitoring mode
DMARC comes last: Google asks for SPF and DKIM to have authenticated mail for at least 48 hours first. The first record uses the policy none, which changes nothing about delivery and sends daily reports to the address after rua. The address in the value below is replaced by the mailbox or group prepared for the reports.
TXT record, host
_dmarcv=DMARC1; p=none; rua=mailto:dmarc-reports@example.comReplace the address with the organisation's own.
Result: Daily reports from receiving mail servers begin to arrive at the address.
Step 5: Tighten the DMARC policy
The reports show which servers send mail in the domain's name and whether their mail passes. A legitimate service that fails is added to the SPF record or given its own DKIM key. When the reports show only legitimate senders passing, the policy is changed from none to quarantine, which moves failing mail to spam, and later to reject.
Result: Mail that falsely carries the domain's name is rejected or marked as spam by receiving servers.
If something goes wrong
The Admin console reports that the DKIM record was not created
Cause: Gmail has been active for less than 24 to 72 hours
Fix: Wait and generate the key again.
The DNS host refuses the DKIM value
Cause: The host limits the length of a TXT record
Fix: Generate a 1024-bit key, or split the value as the host's documentation describes.
Newsletters or invoices land in spam after DMARC is tightened
Cause: The sending service is missing from the SPF record and does not sign with the domain's DKIM key
Fix: Return the policy to none, add the service to SPF or set up its DKIM, then tighten again.
SPF fails although the record exists
Cause: Two SPF records on the domain, or more than ten include entries
Fix: Merge them into one record and remove services that no longer send.
| Symptom | Cause | Fix |
|---|---|---|
| The Admin console reports that the DKIM record was not created | Gmail has been active for less than 24 to 72 hours | Wait and generate the key again. |
| The DNS host refuses the DKIM value | The host limits the length of a TXT record | Generate a 1024-bit key, or split the value as the host's documentation describes. |
| Newsletters or invoices land in spam after DMARC is tightened | The sending service is missing from the SPF record and does not sign with the domain's DKIM key | Return the policy to none, add the service to SPF or set up its DKIM, then tighten again. |
| SPF fails although the record exists | Two SPF records on the domain, or more than ten include entries | Merge them into one record and remove services that no longer send. |
Try Google Workspace on the business's own domain
The trial runs on any of the three Business plans, and the plan can be changed while it runs without losing the remaining days.
Sign-up is on Google's site.
10 per cent off the first year
Google takes 10 per cent off the first year of Business Starter, Business Standard or Business Plus for a new customer who enters a promotion code at sign-up or before the 14-day trial ends. Each code is valid once, for one domain, so codes are issued individually and are not published. Getting Digital takes part in Google's referral programme and sends a code by email on request.
Conditions set by Google: for organisations new to Google Workspace that buy Business Starter, Business Standard or Business Plus online from Google, for one domain. Google's referral programme excludes existing and former customers, government bodies and political organisations.
Questions
- Are all three records necessary for a small business?
- SPF and DKIM are: Google expects at least one of them from every sender of mail to personal Gmail accounts. DMARC is required of senders of more than 5,000 messages a day; for a smaller sender it is the record that stops others from misusing the domain's name.
- Why not set DMARC to reject at once?
- Because a strict policy also rejects the business's own mail from any service that was forgotten in SPF and DKIM. Google recommends starting with the policy none and tightening it once the reports show how the domain's mail is authenticated.
- Do the records have to be changed later?
- The SPF record changes whenever a new service starts sending mail for the domain or an old one stops. The DKIM record stays until the key is replaced. The DMARC record changes when the policy is tightened.
Sources
Last reviewed 18 November 2026 · Getting Digital
