Workflow Tools Control Yard

Home / Email and M365

DKIM record checker

Paste a DKIM key record to see its key type and length, its flags and what is wrong with it, and to split a long key into the strings of at most 255 characters that DNS holds. Or paste a public key to build the record. The page reads only what you give it and does not query DNS.

Where the record goes

A DKIM key is a TXT record at the selector, then _domainkey, then the domain. A signature with d=example.com and s=s1 is checked with the record at s1._domainkey.example.com. In the zone file of example.com the name can be written relative to the zone, as s1._domainkey, without the domain and without a final dot (RFC 1035). Each selector has one TXT record: with two at the same name, RFC 6376 leaves the result undefined. To change keys, publish the new key under a new selector.

The tags of a key record

A key record is a list of tags, each name=value, separated by semicolons. Names are case-sensitive, a tag may appear only once (a repeated tag makes the whole record invalid), and verifiers ignore tags they do not know.

TagRequiredWhat it says
v=DKIM1Recommended; first when presentThe version. If the record starts with v= and any other value, verifiers throw the record away.
k=rsa or k=ed25519Optional; rsa if left outThe key type. Ed25519 comes from RFC 8463. Verifiers ignore a record with a key type they do not know.
p=RequiredThe public key in base64. Spaces inside it are allowed and ignored. An empty p= means the key is revoked: every signature that names the selector fails.
h=sha256Optional; all if left outThe hash algorithms the key may be used with, separated by colons. RFC 8301 forbids sha1, so sha256 is the one that counts; h= is best left out or set to sha256.
s=emailOptional; * if left outThe services the key is for: * for all, or email. Verifiers of email ignore a record that lists neither. RFC 8460 adds tlsrpt, for the key that signs SMTP TLS reports.
t=y, t=sOptionalFlags. y: the domain is testing DKIM, and receivers treat its signed mail like unsigned mail even when a signature fails. s: a signature's i= domain must be its d= domain exactly, not a subdomain.
n=OptionalA note for people. Programs ignore it.
g=DroppedFrom older specifications (RFC 4871 and DomainKeys). RFC 6376 has verifiers ignore it but advises leaving it out, because older verifiers still read it, and to them an empty g= matches no address.

Why a 2048-bit key needs two strings

A TXT record holds one or more strings, and each string holds at most 255 characters: in DNS a string is a length octet and then that many octets (RFC 1035). A DKIM verifier joins the strings of the record with nothing between them (RFC 6376 section 3.6.2.2), so a long record can be split anywhere, even in the middle of the key.

An RSA key of 1,024 bits fits in one string; longer ones do not. RFC 8301 asks signers for at least 2,048 bits and notes that some DNS software handles only a single string per TXT record. If yours does, either split the record by hand as the page shows, or use an Ed25519 key (RFC 8463), whose record fits in one string. The sizes, for keys written as openssl writes them with -pubout, in a record that is v=DKIM1; k=rsa; p= and the key:

RSA key bitsCharacters in p=Characters in the recordTXT strings
1,0242162341
2,0483924102
3,0725645823
4,0967367543

Keys, lengths and algorithms

Sources

More Email and M365 tools