
A DKIM DNS record publishes a public key under a selector-specific hostname. The sending system keeps the corresponding private key and uses it to sign messages. Receivers query DNS using the s= selector and d= signing domain from the message header.
Illustrative TXT value
v=DKIM1; k=rsa; p=MIIBIjANBgkqh...EXAMPLE_ONLY...
This is schematic text, not a working key. Never copy a key from an article. Your mail provider generates the actual key and gives you the record value and hostname.
v=DKIM1 identifies the record version. k=rsa names the key type when present. p= contains the base64-encoded public key; it can be long and DNS providers may display it as adjacent quoted chunks. An empty p= is used to revoke a selector. Other optional tags can describe service or hash constraints; follow the provider’s exact instructions.
Hostname and DNS record type
For selector news and signing domain mail.example.com, the query name is:
news._domainkey.mail.example.com
The provider may ask you to publish a TXT value directly or a CNAME that delegates lookup to its infrastructure. Do not publish both unless the provider explicitly instructs you to. Some DNS dashboards append the zone automatically; entering the full domain into a relative-name field can accidentally duplicate it.
Common publishing mistake
For a DNS zone named example.com, some control panels expect only news._domainkey in the Name field and append .example.com automatically. Others expect the full hostname. If you enter news._domainkey.example.com into an auto-appending panel, you may accidentally create news._domainkey.example.com.example.com. Query the public hostname after saving; the panel's green check is not a DNS lookup.
Validate the published record
Query the exact name from the message using dig or nslookup, or use the DKIM record checker. Confirm that the public answer contains a non-empty key and is not truncated. Then send a real message and inspect whether its signature passes.
DNS correctness is only one part of authentication. The provider must sign with the matching private key, and the signing domain may need to align with the visible From domain for DMARC. See how to check a DKIM record for a step-by-step lookup.
Never publish the private key (BEGIN PRIVATE KEY) as a TXT record. DNS contains the public key only. If the provider supplies a CNAME instead of a p= value, follow that provider's exact setup rather than trying to manufacture a TXT value.