Add SPF and DKIM for Google Workspace in Cloudflare (2026)

4 min read

What you’ll have at the end

Google Workspace's SPF record and DKIM key added to your domain's DNS records in Cloudflare, and DKIM turned on in the Google Admin console. If Google can't see the DKIM record yet, the guide ends at the wait while the DNS change spreads.

Before you start

You’ll need

  • A Google Workspace account with Gmail already turned on for your domain
  • A super administrator sign-in to the Google Admin console
  • Your domain added to Cloudflare, with its DNS managed there
  • A list of any other services that send email from your domain

What it costs. Google's SPF and DKIM help pages and Cloudflare's DNS docs name no charge for adding these records.

You need a super administrator sign-in to the Google Admin console. Google's DKIM help says that after you turn on Gmail for your organisation, you must wait 24–72 hours before you can get your DKIM key.

Google's help says you may not need these records if your domain already has them, or if you bought your domain from a Google partner when you signed up.

Please list every service that sends email from your domain. Google's SPF help says your SPF record should include all of them, and Cloudflare's docs say to add other senders' include: entries to the same record, never a second TXT record starting with v=spf1. If you send only with Google Workspace, the value is:

v=spf1 include:_spf.google.com ~all

You'll move between Google Workspace and Cloudflare. Each step's heading names the tool it happens in.

Following steps from somewhere else? You’re welcome to bring them here.

Steps

  1. 1. Google Workspace: open the Gmail settings

    In the Google Admin console, go to Menu > Apps > Google Workspace > Gmail.

  2. 2. Google Workspace: click Authenticate email

    Click Authenticate email.

  3. 3. Google Workspace: choose your domain

    In the Selected domain menu, select the domain you want to set up DKIM for.

  4. 4. Google Workspace: click Generate New Record

    Click the Generate New Record button.

  5. 5. Google Workspace: choose the key settings and click Generate

    Choose 2048 for the key bit length, which both Google and Cloudflare suggest. Leave the prefix selector as google unless your domain already has a DKIM key with that prefix. Then click Generate.

  6. 6. Google Workspace: copy the DKIM name and value

    Copy the DNS Host name (TXT record name), such as google._domainkey, and the TXT record value, which starts with v=DKIM1; k=rsa; p=

    Google's help says not to click Start authentication yet. Please keep this window open.

  7. 7. Cloudflare: open DNS > Records

    Now please switch to Cloudflare.

    In the Cloudflare dashboard, select your account and domain, then go to DNS > Records.

  8. 8. Cloudflare: check for an SPF record already there

    Look for a TXT record whose content starts with v=spf1.

    • If there is one, select Edit on it, add include:_spf.google.com to its content before the ending such as ~all, select Save, and go to step 11.
    • If there isn't one, go on to step 9.
  9. 9. Cloudflare: add a TXT record for SPF

    Select Add record and enter:

    • Type: TXT
    • Name: @
    • Content: your SPF value, such as v=spf1 include:_spf.google.com ~all
  10. 10. Cloudflare: select Save

    Select Save.

  11. 11. Cloudflare: add a TXT record for DKIM

    Select Add record and enter:

    • Type: TXT
    • Name: the DNS Host name from step 6, such as google._domainkey
    • Content: the TXT record value from step 6, pasted in full
  12. 12. Cloudflare: select Save

    Select Save.

  13. 13. Google Workspace: click Start authentication

    Now please go back to Google Workspace.

    On the Authenticate email page, check that your domain is selected and click Start authentication. Google's help says that when DKIM is working, the status at the top of the page changes to Authenticating email with DKIM.

    If it doesn't change yet, please wait and try again later. Google's DKIM help says it can take up to 48 hours for DKIM to start working after you add the key. If you're at that point, this guide ends here, at the wait.

If something looks different

  • Cloudflare's Google Workspace page lists Proxy status: DNS only for these records. Cloudflare's own DNS records page says proxy status applies to A, AAAA and CNAME records, so you may not see that option for a TXT record.
  • Google's help says the Authenticate email page might keep showing You must update the DNS records for this domain for a while. If you've added the record correctly, you can ignore it.
  • To check DKIM, Google's help says to send an email to someone using Gmail or Google Workspace, not to yourself, and look in the message header for DKIM=pass or DKIM=OK.
  • Cloudflare's Google Workspace page also covers a DMARC record. That is its own task.