Where does a DKIM record go in my DNS?
Every DKIM key sits in a subdomain called _domainkey. The message's signature names a domain and a selector. The receiver joins them to find the key: a selector of foo.bar on example.com is looked up at foo.bar._domainkey.example.com [1]. The selector is just a label, so one domain can have several keys, for example one per mail service.
selector1._domainkey.example.com. TXT "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ..."
The p= value is the public key. The standard's own example record uses v=DKIM1 followed by p= and the key [1]. You do not write the key by hand. Your mail provider generates it and shows you the exact record to paste.
How do I set up DKIM for my business email?
- Find the DKIM page in your mail service Look for domain authentication or email authentication in the settings of your mail provider, newsletter tool or shop platform.
- Generate the key Choose a 2048-bit key if offered. Google recommends it where the domain provider supports it [2].
- Publish the TXT record Copy the host name and value into your DNS provider. Long keys are sometimes split into pieces; your provider's page says how.
- Switch signing on Some services only start signing after you press a verify or start authentication button once the record is live.
Run this once for each service that sends mail as your domain. Each service gets its own selector and its own record.
How long should a DKIM key be?
RFC 6376 first set the floor at 1024 bits for long-lived keys and said receivers must check keys from 512 to 2048 bits [1]. RFC 8301 updated that: signers must use RSA keys of at least 1024 bits for all keys and should use at least 2048 bits, and receivers must validate keys from 1024 to 4096 bits [3]. Google's sender guidelines say sending to personal Gmail accounts requires a DKIM key of 1024 bits or longer, and recommend 2048 bits where your domain provider supports it [2].
Is DKIM the same as SPF?
| SPF | DKIM | |
|---|---|---|
| What it checks | The server that sent the message | A signature on the message itself [1] |
| Lives in DNS as | One TXT record on the domain | A TXT record per selector under _domainkey [1] |
| Google asks for | SPF or DKIM from all senders | SPF, DKIM and DMARC from senders over 5,000 a day [2] |
Google's rule for DMARC says a message must pass SPF or DKIM, or both, and the authenticating domain must be the same domain that appears in the From header [2]. Setting up both means DMARC can pass through either one.
Questions people ask
What is a DKIM selector?
A selector is a label in the DKIM signature that tells the receiver which key to fetch. The receiver looks up selector._domainkey.yourdomain in DNS [1]. One domain can have many selectors, for example one for each service that sends mail for it.
Do I need DKIM if I already have SPF?
Google asks all senders for SPF or DKIM, and senders of more than 5,000 messages a day for SPF, DKIM and DMARC [2]. Even for small senders, having both means DMARC can pass through either one.
Can DKIM be set up without touching DNS?
No. The public key has to be published in DNS for receivers to find it [1]. Some providers add the record for you if your domain's DNS is hosted with them.
Pages that link here
A record, DMARC, Email deliverability, Google Workspace, MX record, Open rate, Phishing, SMTP, SPF record
Blog posts that use this term
See also
- SPF record An SPF record is a line of text in your domain's DNS that lists which mail servers are allowed to send email using your domain name.
- DMARC DMARC is a DNS record that tells mail servers what to do with email that fails your SPF and DKIM checks, and asks them to send you reports.
- DNS DNS is the internet's address book: it turns a domain name like example.com into the number a computer needs to find your website or mail server.
- Email deliverability Email deliverability is whether the email you send actually reaches the recipient's inbox instead of being blocked or sent to spam.
- MX record An MX record is a DNS entry that names the mail server that receives email sent to your domain.
References
- RFC 6376: DomainKeys Identified Mail (DKIM) Signatures, IETF. Read 27/11/2026.
All DKIM keys are stored in a subdomain named "_domainkey".
- Email sender guidelines, Google Workspace Admin Help. Read 27/11/2026.
we recommend using a 2048-bit key if your domain provider supports this.
- RFC 8301: Cryptographic Algorithm and Key Usage Update to DKIM, IETF. Read 27/11/2026.
Signers MUST use RSA keys of at least 1024 bits for all keys. Signers SHOULD use RSA keys of at least 2048 bits.