Skip to content
Cloud Tender — Google Cloud Partner
Administration & Security

Setting Up SPF and DKIM in Google Workspace – Step by Step

Published: —

Setting Up SPF and DKIM in Google Workspace – Step by Step

SPF and DKIM support the authentication of emails sent on behalf of a domain. Correct configuration helps deliverability but does not guarantee it, and on its own neither establishes the cause of nor resolves the “550 Sender verify failed” error.

This guide provides general guidance: all instances of the example.com domain and the felhasznalo@example.com address are fictional examples. The actual DNS values must be determined based on your organization's sending services.

1. SPF – specifying authorized sending servers

SPF is a DNS TXT record that lists the sending systems authorized for the SMTP envelope sender's domain. It does not simply check the From field displayed in the email client.

1.1. Checking the current record

Find your domain's TXT record beginning with v=spf1 and save the original value. Clarify the role of the systems behind the a, mx, include, and exists mechanisms with the administrator; do not remove them arbitrarily. If a suitable SPF record already exists, there is no need to create a new, parallel record.

1.2. Before making changes

  • Check whether Google Workspace is the only service sending on behalf of the domain.
  • Also take stock of your website, booking system, invoicing software, CRM, and newsletter service.
  • Take into account the requirements of every authorized sender's service provider. Authorization may use a different envelope sender subdomain; document this as well.
  • Each domain should have only one SPF record. Authorizations for multiple providers must be combined into one correctly constructed record, not multiple separate SPF TXT records.
  • Check the DNS lookup limit: SPF evaluation allows at most ten mechanisms/modifiers that require lookups; nested include chains also count. This does not mean ten TXT records.

1.3. Changing DNS step by step

  1. Sign in to the provider that manages your domain's DNS zone.
  2. Open the DNS records and find the main domain's existing SPF TXT record.
  3. Only if Google Workspace is the sole authorized sender, you can use the value specified by Google:
v=spf1 include:_spf.google.com ~all
  1. If there are other senders, first construct the complete record based on the providers' documentation. The line above is not a universal solution for every organization.
  2. Save the value and check that a second SPF record has not been created. Do not delete other TXT, MX, verification, or service records.
  3. Wait for the DNS update: depending on the provider and caches, this may take up to 48 hours. Verify using the TTL and an actual public DNS lookup rather than relying solely on elapsed time.

2. DKIM – setting up a digital signature

DKIM uses a cryptographic signature: the receiving server verifies the email using the public key published in DNS. The private key does not need to be copied into DNS. You need the appropriate administrator privileges for Gmail settings and access to the DNS zone.

2.1. Creating a DKIM key in Google

  1. Open the Google Admin console.
  2. Go to Apps → Google Workspace → Gmail → Authenticate email. Labels may change.
  3. Select your domain and check whether DKIM authentication is already active. Do not replace an existing active key without a plan.
  4. Generate a new record if necessary. The recommended key length is 2048 bits; the google selector can only be used if it does not conflict with the existing configuration. After activating a new Gmail service, you may need to wait 24–72 hours for key generation to become available.
  5. Copy the DNS record name and the complete TXT value displayed by Google.

2.2. Creating a TXT record in DNS

  1. Create a TXT record with the hostname provided. For the fictional example.com domain and the google selector, the full name is google._domainkey.example.com. Some management interfaces require only google._domainkey, as they append the domain portion automatically.
  2. The value must be the complete public key generated by Google. Illustrative format, not a working key you can copy and paste:
v=DKIM1; k=rsa; p=<public key generated by Google>
  1. Save the record. If the provider cannot handle the long value, consult them about the proper handling of TXT segments. Google also supports 1024-bit keys, but the 2048-bit version is recommended if the provider supports it.

2.3. Starting authentication

  1. Return to the Authenticate email page in Gmail settings.
  2. Select Start authentication.
  3. If the DNS record is unavailable, check its name and complete value, wait for the update, and then try again.

Publishing the DNS TXT record alone does not replace activation in the Google console.

3. Checking SPF, DKIM, and DMARC

  1. Send a new test email from your domain to a test mailbox you are authorized to inspect. felhasznalo@example.com is only a fictional address; do not send email to it.
  2. In Gmail, open Show original from the message menu.
  3. Check the SPF, DKIM, and DMARC results, as well as the envelope sender checked by SPF and the DKIM d= signing domain. It is advisable to run a separate test for every authorized sender.
  4. SPF PASS or DKIM PASS alone is not always sufficient for DMARC: the domain of at least one successful authentication must align with the visible From domain according to the configured strict or relaxed alignment rule.
  5. DMARC PASS does not require both methods to pass simultaneously; nevertheless, the goal is correctly functioning SPF and DKIM across every sending path.

Do not assume that your organization already has a DMARC record. If one exists, review the policy and reports. p=none is a monitoring policy: it is not equivalent to quarantine or rejection. Plan stricter enforcement only after verifying authorized senders.

4. Troubleshooting

  • SPF permerror: look for multiple SPF records, invalid syntax, or an exceeded lookup limit.
  • DKIM will not start: check the selector, a domain portion appended twice, a truncated key, and DNS propagation.
  • DMARC failure despite PASS: check alignment with the From domain and the third party's envelope sender/signature.
  • 550 Sender verify failed: examine the complete bounce message, whether the sender address exists, the routing, and recipient-side verification. Do not automatically treat it as an SPF/DKIM issue.

Official documentation

Help with setup

Need help configuring Google Workspace email securely? Contact us.

Related articles