DKIM Record Builder

Assemble a DKIM TXT record from key, version, and service type fields

Ad placeholder (leaderboard)

DKIM (DomainKeys Identified Mail) attaches a cryptographic signature to your outgoing email and publishes the matching public key in DNS so receivers can verify nothing was tampered with and the message really came from your domain. This builder formats that public-key TXT record correctly.

How it works

Your mail server signs each message with a private key it keeps secret. The public key half is published as a DNS TXT record at a special hostname:

<selector>._domainkey.<your-domain>

The record value is a list of semicolon-separated tags. The builder assembles them in conventional order:

  • v=DKIM1 — version, always first.
  • k=rsa or k=ed25519 — the key algorithm.
  • h=sha256 — permitted hash algorithms (RSA only; omitted when you allow all).
  • t=... — optional flags: y for test mode, s to forbid subdomain reuse.
  • s=email — restrict the key to the email service type.
  • p=... — the base64 public key itself, placed last by convention.

The builder strips any PEM -----BEGIN/END----- header lines from your pasted key, validates that the remainder is clean base64, and warns when an RSA-2048 record crosses the 255-byte single-string TXT limit.

Worked example

For selector s1, domain example.com, an RSA key, and SHA-256, the hostname is:

s1._domainkey.example.com

and the record value looks like:

v=DKIM1; k=rsa; h=sha256; s=email; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB...

Publish that as a TXT record, send a test message, and check the receiving server’s Authentication-Results header for dkim=pass.

Tips

  • Keep the private key secret and on the signing server only — only the public half ever goes in DNS.
  • Use a fresh selector when rotating keys so the old key can stay published until in-flight mail is delivered.
  • Remove t=y once verification passes; leaving test mode on undermines DMARC.
  • DKIM is one leg of email authentication. Pair it with SPF and a DMARC policy so receivers can act on alignment.
Ad placeholder (rectangle)