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.
| Tag | What it says |
|---|
The record, with spaces tidied, for a DNS control panel that takes the whole value
As strings of at most 255 characters
As a zone file line
Check what DNS returns, once the record is published. PowerShell:
Windows command prompt:
Linux or macOS:
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.
| Tag | Required | What it says |
|---|---|---|
v=DKIM1 | Recommended; first when present | The version. If the record starts with v= and any other value, verifiers throw the record away. |
k=rsa or k=ed25519 | Optional; rsa if left out | The key type. Ed25519 comes from RFC 8463. Verifiers ignore a record with a key type they do not know. |
p= | Required | The 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=sha256 | Optional; all if left out | The 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=email | Optional; * if left out | The 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=s | Optional | Flags. 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= | Optional | A note for people. Programs ignore it. |
g= | Dropped | From 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 bits | Characters in p= | Characters in the record | TXT strings |
|---|---|---|---|
| 1,024 | 216 | 234 | 1 |
| 2,048 | 392 | 410 | 2 |
| 3,072 | 564 | 582 | 3 |
| 4,096 | 736 | 754 | 3 |
Keys, lengths and algorithms
- RSA keys must be at least 1,024 bits, and RFC 8301 says signers should use at least 2,048. Verifiers must handle 1,024 to 4,096 bits, and must not accept a signature made with a shorter key.
- RFC 8301 forbids rsa-sha1 for signing and verifying, so a record with
h=sha1alone is useless. - An Ed25519 key is 32 bytes, 44 characters in base64. Its record has
k=ed25519and the key itself inp=, not the longer form that sits between the BEGIN and END lines of a PEM file; the page converts that form. For backward compatibility a signer can sign with both an RSA and an Ed25519 key, under different selectors. - RFC 6376 names a bare RSAPublicKey for
p=, but its own example (appendix C), and RFC 8463's, publish the longer form thatopenssl rsa -puboutwrites, with the BEGIN and END lines taken off. The page reads both, and builds the record in the second form.
Sources
- Key records, their tags, where they go and how TXT strings are joined: RFC 6376 (sections 3.2, 3.6.1 and 3.6.2, and appendix C). Key sizes and sha1: RFC 8301. Ed25519 keys: RFC 8463. The tlsrpt service type: RFC 8460 section 3.
- Strings of at most 255 characters, and names relative to a zone: RFC 1035 (sections 3.3, 3.3.14 and 5.1).
- The commands: Microsoft's references for Resolve-DnsName (windows-powershell-docs at commit 8fc3941) and nslookup (windowsserverdocs at commit b640f2c), and the dig manual of BIND 9.20.31. Microsoft's documentation is used under the Creative Commons Attribution 4.0 International licence (creativecommons.org/
licenses/ by/ 4.0/). - The key sizes in the table are arithmetic on the layout of the key; the 1,024-bit row matches the example key in RFC 8463 appendix A.2.
More Email and M365 tools
-
SMTP status code lookup
Read a bounce such as 550 5.7.1 or 421 4.4.2: the reply code and the enhanced code by class, subject and detail.
-
Email header analyzer
Paste message headers: each hop and its delay, SPF, DKIM and DMARC results, and Microsoft 365's SCL, BCL and SFV in words.
-
AADSTS error code lookup
Look up AADSTS50126, AADSTS700016 or any other Microsoft Entra sign-in error, alone or in a pasted message.
-
JWT and access token decoder
Read the claims of a Microsoft Entra access or ID token, with exp, iat and nbf as dates, in your browser.
-
dsregcmd /status reader
Paste the output of dsregcmd /status: the join state, each field in words, and the values that point at a problem.
-
Intune and Autopilot error codes
App install codes such as 0x87D1041C, MDM enrollment errors such as 0x8018000A, and Autopilot import errors 806 and 808.
-
Safe Links and URL Defense decoder
See the address inside a Microsoft Safe Links or Proofpoint URL Defense link as plain text, without opening it.
-
Punycode and lookalike checker
Convert xn-- names to Unicode and back, and see when a name mixes scripts or has letters that look like ASCII ones.
-
SPF and DMARC record builder
Build SPF and DMARC records, or paste one to see what each part does.
-
DMARC report viewer
Open DMARC aggregate reports (.xml, .gz or .zip) in your browser: senders, counts, and SPF and DKIM alignment.
-
MTA-STS and TLS-RPT builder
Build the MTA-STS and TLS-RPT records and the policy file, or paste one to read it.