DKIM record generator: how do you build a selector._domainkey TXT record?
How does this check work, and what does the result tell you?
AdminKit's DKIM record generator formats the exact selector._domainkey.<domain> TXT record — v=DKIM1, k=, p= and optional t=/h=/s=/n= tags — from a PUBLIC key you already have, entirely in your browser. It never generates a key pair or sees a private key; publish the result in DNS and confirm it with AdminKit's live DKIM check.
Part of the Email authentication cluster — more tools, guides and terms on email authentication.
Paste a PUBLIC key only — never a private key. This tool never generates a keypair and never sees, stores or transmits a private key; it only formats the DNS record text from the public key you already have.
The label your mail provider assigned to this key, e.g. default, s1, google.
The domain this selector's key will be published under.
Optional. Leave blank to omit, or set * / email.
Paste the output of `openssl rsa -pubout` (or equivalent) — PEM headers and newlines are stripped automatically. Leave blank to build a deliberately revoked (empty p=) record.
Optional, human-readable only — not interpreted by verifiers.
- A selector is required.
- A domain is required.
What the result means
This is the record text built from the selector, domain and PUBLIC key you entered — it says nothing about what your domain currently publishes, and it never saw, generated or stored a private key. To see what is actually live in DNS today, run AdminKit's DKIM check.
Next step
If you don't have a key pair yet, generate one offline with openssl genrsa -out private.pem 2048
followed by openssl rsa -in private.pem -pubout -out public.pem, then paste the contents of
public.pem above — keep private.pem on your mail server only, never in DNS or
anywhere else. Publish the record above as a TXT record at the host shown, then confirm it with the live
DKIM check once DNS has
propagated.
Keep this result
Copy a link to this check so you can share it or run it again later. Want a heads-up if something changes? That's early access, not a live feature yet — tell us and we'll set it up by hand.
How it works and limits
Paste the selector, domain and the PUBLIC key you already have below, and this tool assembles the exact
selector._domainkey.<domain> TXT record string as you type, entirely in your browser — nothing you enter,
including the key itself, is sent to AdminKit or anywhere else. It only formats a record from a key you provide: it
never generates a key pair and never handles a private key. Once you are happy with the result, publish it in your
DNS, then confirm it took effect with AdminKit’s live DKIM check, which queries DNS for real.
What does a DKIM record actually need?
DKIM, defined in RFC 6376, publishes a signing key as a TXT record at
selector._domainkey.<domain>. Its tags, registered in
IANA’s DKIM-Signature Tag Specifications,
are:
v=DKIM1— the fixed version tag, always first.k=— the key algorithm:rsa(the near-universal default) ored25519.p=— required, the base64-encoded public key. An empty value is a deliberate revocation (see the FAQ below).h=— optional, the colon-separated hash algorithms a verifier may accept (sha1,sha256); omitted, any algorithm is acceptable.s=— optional, the colon-separated service types this key applies to, e.g.email.t=— optional, colon-separated flags:ymarks the selector “testing,”srestricts signing to exactly this domain, not its subdomains.n=— optional, a human-readable note for administrators; verifiers never interpret it.
Why do you need a selector, and what happens with an empty key?
A domain can publish many DKIM keys at once, one per sending service, each under its own selector label — RFC 6376
§3.1 defines no DNS record that lists a domain’s active selectors, so the selector has to come from whoever
configured mail sending (usually shown in that provider’s admin panel). Leaving the public key field blank here
builds a record with an empty p=, which RFC 6376 §3.6.1 defines as a deliberately revoked key, not a broken one —
the expected way to retire a selector when rotating keys.
Limits
- This tool only builds the record text from a public key you provide. It never generates a key pair, never sees or stores a private key, never queries DNS, and never publishes anything — you still have to add the record to your own DNS and confirm it with a live check.
- It validates the selector and domain syntax and strips PEM armor down to raw base64 for
p=, but it does not parse the key’s actual cryptographic contents or confirm it is really an RSA or Ed25519 public key — for that, inspect the key withopenssl rsa -pubin -text -noout(or the equivalent for Ed25519) before pasting it in.
If you don’t have a key pair yet, generate one offline with OpenSSL — see
openssl-rsa(1) for the full -pubout option this tool’s “next
step” panel above walks through — and keep the private key file on your mail server only. See
SPF, DKIM and DMARC explained for how DKIM fits together with the other two
mail authentication records, and AdminKit’s live DKIM check and
SPF check once your records are published.
Frequently asked questions
Why does this tool ask for a selector instead of just a domain?
Because DKIM publishes one key per selector, not per domain: RFC 6376 subdivides "the key namespace ... using 'selectors'" (RFC 6376 §3.1), resolving to a DNS name of the form selector._domainkey.domain. A domain can run several selectors at once — one per sending service, rotated over time — so this tool needs the selector to build the right host name, the same selector value AdminKit's live DKIM check asks for.
What's the difference between pasting a public key here and a private key?
A public key is what this tool formats into p= so receivers can verify your mail's signature; a private key is what your mail server uses to create that signature and must never leave it. This tool only ever reads the text you paste to build a record string in your browser — it has no way to tell a pasted private key from a public one, so the responsibility not to paste one is on you, which is why the form displays an explicit public-key-only warning.
Why does the tool split my record into multiple quoted strings?
A DNS TXT record is made of one or more <character-string>s, each limited to 255 octets by RFC 1035 §3.3.14, and an RSA public key's base64 text routinely exceeds that on its own. RFC 6376 §3.6.1 requires a key record longer than 255 characters to be presented as several back-to-back quoted strings, which concatenate into the original value once the record is parsed — most DNS providers' UI does this automatically, but the split form is what to paste into a zone file or a provider that doesn't.
I generated a record with an empty p= — is that a mistake?
No — RFC 6376 states plainly that "an empty value means that this public key has been revoked" (RFC 6376 §3.6.1), which is the expected way to retire a selector when rotating keys or decommissioning a mail-sending service. Leaving the field blank here builds exactly that record on purpose; this tool warns about it so you don't publish it by accident.