How to Add a 2048-bit DKIM Record to Google Cloud DNS
When you generate a 2048-bit DKIM key in Google Workspace (Gmail) or providers like SendGrid, Postmark, and Mailgun, the value is ~410 characters long. Pasting it directly into Google Cloud DNS fails with:
Google Cloud DNS Error
Invalid value for 'TXT data': Value too long (longer than 255 characters)
1
Generate Key in Google Admin
Open Google Admin → Apps → Google Workspace → Gmail → Authenticate email, and copy the 2048-bit TXT record value.
2
Split Into Two Quoted Strings
Enter your domain and paste the raw DKIM key above. It splits at 255 characters into two space-separated quoted strings.
3
Paste Into Single TXT Field
In Cloud DNS, click Add Standard, choose TXT, and paste the output into the single TXT data 1 input box.
Verify Your DKIM Record in DNS
After saving the record in Google Cloud DNS, run this terminal command to confirm both strings resolve properly before clicking Start Authentication in Google Workspace:
dig TXT google._domainkey.yourdomain.com +short
Why Does Google Cloud DNS Have a 255-Character TXT Limit?
Under RFC 1035 (Section 3.3.14), DNS TXT records store text as one or more length-prefixed character strings. Because the length byte is an unsigned 8-bit integer, no single string in a DNS packet can exceed 255 bytes (255 characters).
A 2048-bit RSA public key encoded in Base64 (v=DKIM1;k=rsa;p=MIIBIjANBg...) is 408 to 450 characters long. To fit inside a single DNS TXT resource record, it must be split into multiple contiguous quoted strings ("string_1" "string_2"). Receiving mail servers automatically concatenate those strings with no spaces when validating your email signature per RFC 6376.
Frequently Asked Questions
Should I click "Add item" in Google Cloud DNS for the second string?
No. In Google Cloud DNS, clicking "Add item" creates two separate TXT records in the record set, and DNS resolvers may return them in arbitrary order. Instead, paste both double-quoted strings ("first 255 chars" "remaining chars") separated by a single space into the single TXT data 1 field.
What DNS name should I use for Google Workspace DKIM?
By default, Google Workspace uses the selector google, so the DNS record name is google._domainkey.yourdomain.com. (in Cloud DNS, simply type google._domainkey in the DNS name prefix box).
Does splitting the DKIM key at 255 characters break RSA key verification?
No. RFC 6376 Section 3.6.2.2 mandates that DKIM verifiers join all contiguous character-strings in a TXT record without adding spaces before parsing the p= public key tag.
Does this also work for AWS Route 53, Cloudflare, DigitalOcean, and BIND?
Yes. AWS Route 53, Azure DNS, DigitalOcean DNS, and standard BIND zone files use the exact same "chunk1" "chunk2" RFC 1035 syntax for TXT strings over 255 characters.