Guide · Google Workspace
SPF, DKIM and DMARC for Google Workspace, step by step
If your business email runs on Google Workspace (Gmail with your own domain), these are the steps to stop criminals spoofing your domain and keep your emails out of spam. Allow about an hour of work, then a few weeks of monitoring before the final step.
What you need
- A Google Workspace super administrator account.
- Access to your domain's DNS settings. This is usually where you bought the domain, or wherever your website is hosted.
- A list of every other service that sends email as your domain: invoicing, newsletters, website contact forms, CRM and booking systems.
Step 1: SPF
SPF lists the servers allowed to send email for your domain. At your DNS host, check for an existing TXT record at the root of the domain (often shown as @) that starts v=spf1. You must only ever have one.
If you only send through Google Workspace, the record is:
v=spf1 include:_spf.google.com ~all
If other services send for you, add their include: value from their help pages before the ~all. Keep the total under 10 DNS lookups. The checker counts them for you.
Step 2: DKIM
If you don't set up your own key, Gmail signs your mail with a default Google domain. That signature doesn't match your domain, so it doesn't help your DMARC result. Setting up your own key takes three parts: generate it, publish it, then switch it on.
- Sign in to the Google Admin console as a super administrator.
- Go to Menu > Apps > Google Workspace > Gmail and click Authenticate email.
- Select your domain and click Generate new record. Choose a 2048-bit key and keep the default selector,
google, unless that name is already in use. - Google shows a TXT record. At your DNS host, add a TXT record named
google._domainkeywith the long value shown. Some DNS hosts can't hold a 2048-bit key in one field; if yours rejects it, check its help pages for splitting long TXT records, or go back and generate a 1024-bit key instead. - Once the record has taken effect (usually within an hour, occasionally up to 48 hours), return to Authenticate email and click Start authentication. The status should change to show that email is being authenticated with DKIM.
If you've only just turned on Gmail for your domain, Google makes you wait 24 to 72 hours before you can generate a DKIM key. Do steps 1 and 3 in the meantime.
Remember the other services from your list. Most offer their own DKIM setup, often called "domain authentication". Turn it on for each one, because DMARC needs every legitimate sender to pass SPF or DKIM.
Step 3: DMARC in monitoring mode
Add a TXT record with the name _dmarc and this value, using an address you can receive mail at:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.co.uk; fo=1
Nothing is blocked yet. Receiving email providers start sending daily reports showing every server that sent mail using your domain, and whether it passed.
Step 4: Watch the reports for two to four weeks
Look for two things: your genuine services failing (fix them with SPF or DKIM) and senders you don't recognise (usually spoofing, which DMARC will block in the next step). Run the checker again to confirm SPF and DKIM pass.
Step 5: Enforce
When all your genuine mail passes, change p=none to p=quarantine, so failing mail goes to spam. After another couple of weeks without problems, change it to p=reject. That's full protection: receivers refuse email that fakes your domain.
Why Google cares
Google requires everyone sending to Gmail addresses to set up SPF or DKIM, and anyone sending more than 5,000 messages a day to set up SPF, DKIM and DMARC. Even a small business benefits: authenticated mail is less likely to be marked as spam, and your customers are protected from fake invoices in your name.
General guidance only. Menu names in the Admin console change from time to time. If something doesn't match, Google's own instructions are linked below. Test changes carefully: a wrong record can stop your email being delivered.