What you'll set up
For a domain like example.com that uses Google Workspace for email, you need these DNS records. Replace example.com with your domain throughout.
| Record | Name | What it does |
|---|---|---|
| MX | @ | Delivers incoming mail to Gmail |
| TXT (SPF) | @ | Authorizes Google's servers to send for your domain |
| TXT (DKIM) | google._domainkey | Publishes the public key Google uses to sign your mail |
| TXT (DMARC) | _dmarc | Tells receivers what to do with mail that fails, and where to send reports |
You'll need a Google Workspace super administrator account and access to your domain's DNS, wherever it's hosted. If you bought the domain through Google during sign-up, your DNS is managed by Squarespace Domains (which took over Google Domains), and Google may have added some records for you.
Step 1: MX records
If mail already arrives in Gmail, skip ahead. For new setups Google uses a single MX record:
example.com. MX 1 smtp.google.com.
Older setups use several records whose values start with aspmx. Google still supports them, so there's no need to change an existing setup. Remove any MX records from a previous provider, then check with the MX lookup.
Step 2: SPF
If Google Workspace is the only thing sending email as your domain:
example.com. TXT "v=spf1 include:_spf.google.com ~all"
If you already have an SPF record, add include:_spf.google.com to it instead of creating a second one. A domain must have exactly one SPF record. For example, with a newsletter service as well:
v=spf1 include:_spf.google.com include:servers.newsletter.example ~all
Google's include costs several of SPF's 10 allowed DNS lookups, because it includes further records of its own. Check your total with the SPF checker, and see fixing too many DNS lookups if you're close to the limit.
Step 3: DKIM
Until you set up DKIM, your mail isn't signed with your own domain's key. In the headers of messages sent before setup you'll typically see a signature from a Google-owned domain instead, for example one ending in gappssmtp.com:
DKIM-Signature: v=1; a=rsa-sha256; d=example-com.20230601.gappssmtp.com; s=20230601; …
Whatever the default looks like, the signing domain isn't example.com, so it doesn't count for DMARC. DMARC then depends on SPF alone, which fails whenever a message is forwarded. Setting up DKIM for your domain takes two visits to the Admin console, with a DNS change in between.
Generate the key
- In the Google Admin console (admin.google.com), go to Menu › Apps › Google Workspace › Gmail › Authenticate email.
- Choose your domain from the list. Google requires a unique DKIM key for each domain you send from.
- Select Generate New Record. Choose a 2048-bit key unless your DNS host can't store long TXT records, in which case use 1024. Leave the selector prefix as
googleunless you already use that name for something else. - Google shows a DNS Host name (
google._domainkey) and a TXT record value starting withv=DKIM1; k=rsa; p=.
Publish it
Add a TXT record at your DNS host with that name and value:
google._domainkey.example.com. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA…"
- Long values. A 2048-bit key is longer than the 255-character limit of a single TXT string. Most DNS hosts split it automatically. Some want you to split it into several quoted strings yourself; never split it into two separate records.
- No extra characters. Paste the value exactly. Added spaces, line breaks or quotes inside the key break it.
- Check it with the DKIM checker using the selector
google. It should show an RSA 2048-bit key.
Start authentication
Go back to Authenticate email, choose the domain again and select Start authentication. The status should change to say that email is being authenticated with DKIM. If Google says it can't find the record, DNS hasn't caught up yet; Google notes it can take up to 48 hours, though it's usually much quicker.
Then send a test message to an address outside your organization and check its headers in the header analyzer. You want DKIM: pass signed by example.com and aligned with the From domain.
Step 4: DMARC
Publish DMARC at your DNS host, starting in monitoring mode:
_dmarc.example.com. TXT "v=DMARC1; p=none; rua=mailto:[email protected]"
Google suggests waiting 48 hours after setting up SPF and DKIM before adding DMARC, so both are fully in place when reports start. The DMARC generator builds the record and warns about common mistakes. Then follow How to set up DMARC: read the reports for a few weeks, fix other services that send as your domain, and move to p=quarantine and then p=reject.
If you'd like the reports delivered to a Google Group or a shared mailbox, create a dedicated address such as [email protected]; reports arrive daily from Google, Microsoft, Yahoo and others as zipped XML files. Our guide to reading DMARC reports explains what's in them.
Other things that send as your domain
Printers, scanners and apps: the SMTP relay service
Devices and applications that need to send mail can use Google's SMTP relay service (Apps › Google Workspace › Gmail › Routing › SMTP relay service), restricted to your office's IP addresses, to senders using SMTP authentication, or both. Relayed mail leaves from Google's servers, so it's covered by Google's SPF include. It's a better option than letting devices send directly from your office connection. Send a test through the relay and check its headers to confirm it passes DMARC for your domain.
Third-party services
Newsletters, CRMs, helpdesks and billing tools that send as your domain need DKIM set up in that service, usually by adding CNAME or TXT records it provides. Google's DKIM only covers mail sent through Gmail and the SMTP relay.
"Send mail as" another address
If users send as an address at a different domain using Gmail's "Send mail as" feature, that domain's own SPF, DKIM and DMARC apply. Configure it to send through that domain's mail server, not through Gmail directly, or messages will fail that domain's DMARC.
Gmail's sender requirements
Since 2024, Gmail has required authentication from everyone sending to its users, with stricter rules for bulk senders, roughly 5,000 or more messages a day to personal Gmail accounts:
| Requirement | All senders | Bulk senders |
|---|---|---|
| SPF or DKIM | Required | Both required |
| DMARC record | Recommended | Required, at least p=none |
| From domain aligned with SPF or DKIM | Recommended | Required |
| Valid forward and reverse DNS for sending IPs | Required | Required |
| TLS for sending | Required | Required |
| Spam rate in Postmaster Tools | Below 0.3% | Below 0.3%, ideally under 0.1% |
| One-click unsubscribe for marketing and subscribed mail, honored within 48 hours | — | Required |
When you send through Google Workspace itself, Google takes care of TLS and reverse DNS. Your part is SPF, DKIM, DMARC and sending mail people want. Since November 2025 Gmail has been ramping up enforcement: mail that doesn't meet the requirements faces temporary and permanent rejections, not just spam filtering, and new domains are held to an accelerated timetable.
Google Postmaster Tools
If you send more than a few hundred messages a day to Gmail users, add your domain to Google Postmaster Tools (postmaster.google.com). You verify the domain with a TXT or CNAME record, and it then shows your spam rate, reputation, authentication results, delivery errors and a compliance status dashboard for the sender requirements. It's the best early warning that something is wrong.
Troubleshooting
"The DKIM record can't be found" when starting authentication
Check the record with the DKIM checker (selector google). Common causes: the name was entered as google._domainkey.example.com at a host that adds the domain itself, creating google._domainkey.example.com.example.com; the key was cut short by the DNS panel; or DNS simply hasn't caught up.
DKIM passes, but not for your domain
Authentication hasn't been started for this domain, it's still within Google's 48-hour window, or the message was sent from a different domain in your account that doesn't have its own key yet.
DMARC fails for mail sent by a website or app
The app is probably sending directly with your domain in the From address, without going through Google. Route it through the SMTP relay service, or set up DKIM for your domain in the sending service.
Mail from your own users lands in spam
Look at the message headers. If SPF, DKIM and DMARC all pass for your domain, the cause is reputation or content rather than authentication; see Why are my emails going to spam?
Frequently asked questions
Should I use ~all or -all with Google Workspace?
Google recommends ~all. Once you have DMARC at quarantine or reject, receivers follow the DMARC policy, so ~all loses nothing and is a little more forgiving while you find every sender.
Do I need a DKIM key for each domain?
Yes. Google requires a unique DKIM key for each domain you send from, generated in Authenticate email and published as its own TXT record. Each domain also needs its own SPF and DMARC records.
Can I rotate the DKIM key?
Yes. Generate a new record with a different selector prefix (for example google2), publish it, start authentication with the new key, and remove the old record after a few days.
Why does Google offer a 1024-bit key?
Only for DNS hosts that can't store the longer value of a 2048-bit key. 2048-bit is the current standard; use 1024 only if you have no choice, and move to a host that supports longer records when you can.
Does Google Workspace check DMARC on mail it receives?
Yes. Gmail enforces other domains' DMARC policies on incoming mail and sends aggregate reports to the domains that ask for them.