DKIM Record Generator

Create a DKIM key pair and the TXT record to publish.
Key
Created by your browser (Web Crypto). Nothing is sent to us.

Your DKIM record

TypeTXT
Names202611._domainkeymost DNS panels add the domain
Full names202611._domainkey.yourdomain.com
Valuev=DKIM1; k=rsa; p=…
Zone files202611._domainkey.yourdomain.com. 3600 IN TXT "v=DKIM1; k=rsa; p=…"

    Check it once published →

    A DKIM record generator creates the key pair your mail server signs with and the DNS TXT record receivers use to verify the signature. The private key stays on your server; the public key goes in DNS at selector._domainkey.yourdomain.

    How to Set Up DKIM With Your New Key

    Publish the public key, give the private key to the software that signs your mail, then send a test message.

    Your browser creates the key pair and sends nothing; the private key goes to your mail server (OpenDKIM, rspamd, Exim, SES), which signs with selector s202611; the public key goes in DNS as a TXT record at s202611._domainkey (v=DKIM1; k=rsa; p=…); the receiver reads d= and s= from the signature, fetches the key and gets dkim=pass.
    One key pair, two places: the private key on your mail server, the public key in DNS.
    1. Add a TXT record (what DNS records are) at your DNS host with the name and value above (the NS lookup shows which company runs your DNS). Long values may need to be split into several quoted strings in the same record; most DNS panels do this for you.
    2. Install the private key on the server that sends your mail (table below), with the same domain and selector.
    3. Wait for the TTL (often an hour), then run the DKIM checker with your selector.
    4. Send yourself a message and paste its headers into the email header analyzer: dkim=pass with d= your domain means it works. Then remove t=y if you set it.
    5. Add a DMARC record so receivers know what to do with mail that fails.
    Signing softwareWhere the private key goes
    OpenDKIM (with Postfix or Sendmail)Save it as a file readable only by OpenDKIM, then add a KeyTable line: s202611._domainkey.example.com example.com:s202611:/etc/opendkim/keys/example.com/s202611.private, and a SigningTable line for your addresses
    rspamdIn dkim_signing.conf: selector and the key file's path
    EximOn the SMTP transport: dkim_domain, dkim_selector and dkim_private_key (the file's path)
    Amazon SES (BYODKIM)Paste the key in the "one line, no header" form (SES accepts RSA keys of 1024 to 2048 bits)
    Google Workspace, Microsoft 365, Mailchimp…Not needed: these services create the key and give you the record to publish (steps)

    Which DKIM Key Should I Choose?

    RSA 2048-bit: every receiver verifies it, and it is the size RFC 8301 recommends.

    KeyRecord lengthUse it when
    RSA 2048about 410 charactersAlways, unless your DNS host can't store it. Two TXT strings in one record
    RSA 1024about 235 charactersOnly for a DNS host limited to one 255-character string. The minimum receivers accept
    RSA 4096about 750 charactersNot offered: many DNS panels refuse records that long, and 2048 is enough
    Ed25519about 65 charactersAs a second signature next to RSA: many receivers don't verify it yet. Paste its public key above to build the record

    DKIM Record Tags, Briefly

    TagWhat it doesDefault
    v=DKIM1Version; if present it must come firstDKIM1
    k=Key type: rsa or ed25519 (RFC 8463)rsa
    p=The public key in base64. Empty means the key is revokedrequired
    t=y: testing, receivers shouldn't act on failures; s: the signer identity (i=) must use exactly the d= domain, not a subdomainnone
    h=Hash algorithms allowed; only sha256 is still valid (RFC 8301)all
    s= · n=Service type (email or *) and notes for humans; rarely used* · none

    Built in your browser: the key pair, the record and anything you paste stay on your device. Last verified 22 November 2026 (RFC 6376, RFC 8301, RFC 8463).

    Frequently Asked Questions

    How do I create a DKIM record?
    Enter your domain and a selector, click "Create key pair", and save the private key. Publish the TXT record shown (name selector._domainkey, value v=DKIM1; k=rsa; p=…) at your DNS host, install the private key in the software that signs your mail, then check the record with the DKIM checker.
    Is it safe to generate a DKIM key online?
    Here, yes: your browser creates the key with its built-in Web Crypto, and the page sends nothing to us or anyone. You can check: open the browser's network tab, or disconnect from the internet after the page loads, and the key is still created. Keep the private key secret; only the public key goes in DNS.
    What is a DKIM selector?
    The name that tells receivers where to find the key: the s= value in each signature, published at selector._domainkey.yourdomain. Choose any short name of letters, digits and hyphens. A dated name such as s202611 (the default here) shows how old the key is and makes the next one easy to name when you rotate.
    Can I have more than one DKIM record?
    Yes, one per selector: Google Workspace, your newsletter service and your own server can each publish a key under their own selector, and receivers fetch the one named in each signature. Never publish two TXT records under the same selector name: receivers can't tell which key to use, and DKIM can fail.
    How long should a DKIM key be: 1024 or 2048 bits?
    2048-bit. RFC 8301 requires at least 1024 bits and recommends 2048, and receivers ignore keys under 1024 bits. Choose 1024 only if your DNS host can't store the longer record (a 2048-bit record is about 410 characters, split into two strings).
    Do I need this for Google Workspace or Microsoft 365?
    No. Google Workspace, Microsoft 365 and most email services create the key themselves and give you the record (or CNAMEs) to publish. This generator is for software you run yourself (OpenDKIM, rspamd, Exim) and for services that let you bring your own key, such as Amazon SES (BYODKIM).
    How often should I rotate DKIM keys?
    M3AAWG recommends at least every six months. Create a key under a new selector, publish it, switch signing to it, and keep the old record for a few days so mail already sent with the old key still verifies. Then revoke the old key by emptying its p= value.

    Next steps

    Related Tools

    DKIM Checker
    Check the published key: type, size and test mode.
    DMARC Record Generator
    The policy receivers apply when DKIM and SPF fail.
    SPF Record Generator
    List the servers allowed to send as your domain.
    Email Header Analyzer
    See if a real message passed DKIM.