Xerobit

DKIM Record Generator: Build Your DNS TXT Record

Enter your selector, domain and RSA or Ed25519 public key to produce a correctly formatted DKIM TXT record. The tool automatically splits values longer than 255 characters so they fit standard DNS limits. Everything runs locally in your browser and nothing is uploaded.

Paste the Base64 public key, or the whole PEM block. This sample is only a placeholder: generate your own key pair.

Receiving servers will not reject failing messages when enabled.

Result

  • Hostname
    default._domainkey.example.com

    Add a TXT record at this name in your DNS zone.

  • TXT value
    "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyVTwXFJ7s5DJVVrPtZKhoSB7TA/5r99ayzgis9Yrw15K6UZ5Zy9sNnDxIijsIzxr4uRS+YSIQVpn3d2HTQHjxMnpdOOR9Cf34USQnOqM0lKLzlUmbqUjWEzITrvPh9u7urMkHnLr112dyUSFVRkiOyPYJ4c1lp3OoK5gAIr3NQDU72L1AiZxwNIaJhPx/SHNL" "/w3F2UKaeOW0r/QGKGTrcygUtu9eKXhfdjQgRKlJxua8WN1DkAEubv6bF3Dhnj+pEUt+k0mlSRvBY9DZ3bj7uqXuac6PCX43Kj8ZqkheV8haDasivCXwbUDQJOE2XY31xy4vSH0JzipXJAaO94XdQIDAQAB"

    Split into 2 chunks of max 255 characters.

  • Record value
    v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyVTwXFJ7s5DJVVrPtZKhoSB7TA/5r99ayzgis9Yrw15K6UZ5Zy9sNnDxIijsIzxr4uRS+YSIQVpn3d2HTQHjxMnpdOOR9Cf34USQnOqM0lKLzlUmbqUjWEzITrvPh9u7urMkHnLr112dyUSFVRkiOyPYJ4c1lp3OoK5gAIr3NQDU72L1AiZxwNIaJhPx/SHNL/w3F2UKaeOW0r/QGKGTrcygUtu9eKXhfdjQgRKlJxua8WN1DkAEubv6bF3Dhnj+pEUt+k0mlSRvBY9DZ3bj7uqXuac6PCX43Kj8ZqkheV8haDasivCXwbUDQJOE2XY31xy4vSH0JzipXJAaO94XdQIDAQAB

    Unquoted raw value for reference.

By · Published · How we build and test tools

How to use the dkim record generator

  1. Enter your selector, the short label that identifies this DKIM key pair.
  2. Type the domain that signs the mail (the d= value in the DKIM-Signature header), without a trailing dot.
  3. Choose the key type (RSA or Ed25519) and paste the public key. A full PEM block is accepted.
  4. Enable testing mode if you are still trialling DKIM; it adds t=y, which tells verifiers not to treat failures differently from unsigned mail.
  5. Copy the generated hostname and TXT value, then add them to your DNS zone. Use the quoted chunks exactly as shown.

How a DKIM record is structured

A DKIM TXT record is a semicolon-separated list of tags defined in RFC 6376. The required tags are v (version, always DKIM1), k (key type, usually rsa or ed25519) and p (the Base64-encoded public key). Optional tags include s for service type and t for flags.

For example, a minimal record looks like this:

v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A...

The hostname where this record lives follows the pattern selector._domainkey.domain. If your selector is s1 and your domain is example.com, the full DNS name is s1._domainkey.example.com.

Why DNS requires 255-character chunks

DNS TXT records store data as one or more character strings, each prefixed by a single length byte. That byte limits each string to 255 octets. When your DKIM public key plus the tag overhead exceeds 255 characters, the value must be split into multiple quoted strings within the same TXT record.

This dkim record generator handles that splitting automatically. A 2048-bit RSA key produces 392 Base64 characters in its standard SubjectPublicKeyInfo form, which combined with the v, k and other tags pushes the total past 410 characters. The output wraps it into two quoted segments that DNS software concatenates on lookup.

If you publish the record without quotes or as a single unbroken string longer than 255 bytes, many DNS providers will reject it or silently truncate the key, causing verification failures.

Common DKIM tag reference

TagMeaningExample
vVersion, must be DKIM1v=DKIM1
kKey algorithmk=rsa
pBase64 public key datap=MIIB...
sAllowed service typess=email
tFlags (y = testing, s = strict subdomain match)t=y
hAcceptable hash algorithms (optional, rarely needed)h=sha256

An empty p tag (p=) signals that the key has been revoked. Receiving servers should treat any message signed with that selector as unverified.

Preparing your public key

Most mail platforms and key-generation tools output the public key in PEM format, wrapped between -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines. DNS does not use PEM formatting. You need only the Base64 body with all whitespace removed.

For a 2048-bit RSA key, the cleaned Base64 string is 392 characters and usually starts with MIIB. For Ed25519, it is much shorter at 44 characters. Paste the cleaned string, or the whole PEM block, into this dkim record generator, which strips the PEM lines and whitespace for you. It checks that an RSA value really is a public key of at least 1024 bits and that an Ed25519 value is 32 bytes, so a private key or certificate is rejected.

A published key may contain only A-Z, a-z, 0-9, +, / and =.

Fitting DKIM into your email authentication stack

DKIM alone proves that a message was signed by someone holding the private key, but it does not tell receivers which domains are authorized to send mail or what to do with failures. Pair it with an SPF record to declare permitted sending IPs, and a DMARC record to instruct receivers how to handle messages that fail either check.

After publishing your DKIM TXT record, validate it with a DKIM checker to confirm propagation and correct syntax. Also verify your SPF alignment using an SPF record checker.

Together these three mechanisms form the foundation of modern email authentication. Missing any one of them weakens deliverability and increases the risk of spoofing.

Worked examples

ExampleInputResult
RSA 2048-bit keySelector: s1; Domain: example.com; Key type: rsa; Public key (Base64): MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyVTwXFJ7s5DJVVrPtZKhoSB7TA/5r99ayzgis9Yrw15K6UZ5Zy9sNnDxIijsIzxr4uRS+YSIQVpn3d2HTQHjxMnpdOOR9Cf34USQnOqM0lKLzlUmbqUjWEzITrvPh9u7urMkHnLr112dyUSFVRkiOyPYJ4c1lp3OoK5gAIr3NQDU72L1AiZxwNIaJhPx/SHNL/w3F2UKaeOW0r/QGKGTrcygUtu9eKXhfdjQgRKlJxua8WN1DkAEubv6bF3Dhnj+pEUt+k0mlSRvBY9DZ3bj7uqXuac6PCX43Kj8ZqkheV8haDasivCXwbUDQJOE2XY31xy4vSH0JzipXJAaO94XdQIDAQAB; Service type: all; Testing mode (t=y): noHostname: s1._domainkey.example.com; TXT value: "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyVTwXFJ7s5DJVVrPtZKhoSB7TA/5r99ayzgis9Yrw15K6UZ5Zy9sNnDxIijsIzxr4uRS+YSIQVpn3d2HTQHjxMnpdOOR9Cf34USQnOqM0lKLzlUmbqUjWEzITrvPh9u7urMkHnLr112dyUSFVRkiOyPYJ4c1lp3OoK5gAIr3NQDU72L1AiZxwNIaJhPx/SHNL" "/w3F2UKaeOW0r/QGKGTrcygUtu9eKXhfdjQgRKlJxua8WN1DkAEubv6bF3Dhnj+pEUt+k0mlSRvBY9DZ3bj7uqXuac6PCX43Kj8ZqkheV8haDasivCXwbUDQJOE2XY31xy4vSH0JzipXJAaO94XdQIDAQAB"; Record value: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyVTwXFJ7s5DJVVrPtZKhoSB7TA/5r99ayzgis9Yrw15K6UZ5Zy9sNnDxIijsIzxr4uRS+YSIQVpn3d2HTQHjxMnpdOOR9Cf34USQnOqM0lKLzlUmbqUjWEzITrvPh9u7urMkHnLr112dyUSFVRkiOyPYJ4c1lp3OoK5gAIr3NQDU72L1AiZxwNIaJhPx/SHNL/w3F2UKaeOW0r/QGKGTrcygUtu9eKXhfdjQgRKlJxua8WN1DkAEubv6bF3Dhnj+pEUt+k0mlSRvBY9DZ3bj7uqXuac6PCX43Kj8ZqkheV8haDasivCXwbUDQJOE2XY31xy4vSH0JzipXJAaO94XdQIDAQAB
Ed25519 keySelector: ed; Domain: mail.example.org; Key type: ed25519; Public key (Base64): NGsmpYRP02OPiGqOL5gip89fT1i8Jk7pNudWz8zyT0w=; Service type: all; Testing mode (t=y): noHostname: ed._domainkey.mail.example.org; TXT value: "v=DKIM1; k=ed25519; p=NGsmpYRP02OPiGqOL5gip89fT1i8Jk7pNudWz8zyT0w="; Record value: v=DKIM1; k=ed25519; p=NGsmpYRP02OPiGqOL5gip89fT1i8Jk7pNudWz8zyT0w=
RSA key in testing modeSelector: test; Domain: example.com; Key type: rsa; Public key (Base64): MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmT7NvDmuwMFZVNVNuaXoXr1MbQ8V7XQ0mC3GKfQtHd0zQnOZCb9KzlcFQ//giALom0Gxd8cBeZ9+rP26gc/F0g8Ku+lwKplD15DBb9HyEv9GPTXW+dKsQtBsfNMesjBfVcaWbcTWjDLJBcnttYWvZzx4css5nRweqpwdDbWJAu1Cfxqbuyf/aMeH7cspBdv2kxuLOj95nZ9do0E2Nz3xT/2pANJwVFNWr2xxB6BPjW03yqsULtxw0/wZ9lUH/cLp3uFrWK7tvBJxVkWJnmWIE7jgC8GZker+vAbsEqHVBWzo3Sk6hEt2mqvmEf+ugMgzy1NMsUSYvIONfOCvaod53wIDAQAB; Service type: email; Testing mode (t=y): yesHostname: test._domainkey.example.com; TXT value: "v=DKIM1; k=rsa; s=email; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmT7NvDmuwMFZVNVNuaXoXr1MbQ8V7XQ0mC3GKfQtHd0zQnOZCb9KzlcFQ//giALom0Gxd8cBeZ9+rP26gc/F0g8Ku+lwKplD15DBb9HyEv9GPTXW+dKsQtBsfNMesjBfVcaWbcTWjDLJBcnttYWvZzx4css5nRweqpwdDbWJAu1Cfxqbuyf/aMeH" "7cspBdv2kxuLOj95nZ9do0E2Nz3xT/2pANJwVFNWr2xxB6BPjW03yqsULtxw0/wZ9lUH/cLp3uFrWK7tvBJxVkWJnmWIE7jgC8GZker+vAbsEqHVBWzo3Sk6hEt2mqvmEf+ugMgzy1NMsUSYvIONfOCvaod53wIDAQAB; t=y"; Record value: v=DKIM1; k=rsa; s=email; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmT7NvDmuwMFZVNVNuaXoXr1MbQ8V7XQ0mC3GKfQtHd0zQnOZCb9KzlcFQ//giALom0Gxd8cBeZ9+rP26gc/F0g8Ku+lwKplD15DBb9HyEv9GPTXW+dKsQtBsfNMesjBfVcaWbcTWjDLJBcnttYWvZzx4css5nRweqpwdDbWJAu1Cfxqbuyf/aMeH7cspBdv2kxuLOj95nZ9do0E2Nz3xT/2pANJwVFNWr2xxB6BPjW03yqsULtxw0/wZ9lUH/cLp3uFrWK7tvBJxVkWJnmWIE7jgC8GZker+vAbsEqHVBWzo3Sk6hEt2mqvmEf+ugMgzy1NMsUSYvIONfOCvaod53wIDAQAB; t=y

FAQ

What is a DKIM selector?

A selector is a short label that identifies a specific DKIM key pair for a domain. It allows you to rotate keys or run different keys for different mail streams without conflict. The selector becomes part of the DNS hostname as selector._domainkey.domain.

Why does my DKIM record need to be split into chunks?

DNS TXT records limit each individual string to 255 bytes. Because RSA public keys often exceed that length once encoded in Base64, the value must be broken into multiple quoted strings. Receivers concatenate them automatically during lookup.

Should I enable testing mode?

Testing mode adds t=y to the record, which tells verifiers that the domain is still testing DKIM and that failures should not be treated differently from unsigned mail. Enable it while you first deploy DKIM, then remove it once you confirm everything signs correctly.

Can I use Ed25519 instead of RSA?

Yes, if your signing software supports it (RFC 8463). Ed25519 keys are much shorter: set the k tag to ed25519 and use the 44-character Base64 of the raw 32-byte public key. Support among receivers is still limited, so most senders publish an RSA 2048-bit key as well and sign with both.

Does this tool upload my key to a server?

No. This dkim record generator runs entirely in your browser. Your public key, domain and selector never leave your device.

How do I revoke a DKIM key?

Publish a record for the same selector with an empty p tag, such as v=DKIM1; k=rsa; p=. This tells receivers the key is no longer valid. After revocation, generate a new key with a different selector.

Does this tool check that my key is valid?

It checks the structure only: an RSA value must be a SubjectPublicKeyInfo of at least 1024 bits (a warning appears below 2048 bits) and an Ed25519 value must be 32 bytes. It cannot tell whether the key matches your private key or whether your mail server signs with it.