[{"data":1,"prerenderedAt":263},["ShallowReactive",2],{"tool-dkim-generator":3},{"id":4,"title":5,"body":6,"description":241,"extension":242,"faq":243,"h1":256,"intro":257,"meta":258,"navigation":170,"path":259,"seo":260,"stem":261,"__hash__":262},"tools\u002Ftools\u002Fdkim-generator.md","DKIM Generator: Create a DKIM Key Pair and Record",{"type":7,"value":8,"toc":235},"minimark",[9,14,54,58,74,90,93,97,209,216,220,231],[10,11,13],"h2",{"id":12},"how-to-use-the-dkim-generator","How to use the DKIM generator",[15,16,17,26,29,36,39],"ol",{},[18,19,20,21,25],"li",{},"Enter your domain and a selector. A date-based selector such as ",[22,23,24],"code",{},"s2026"," makes rotation obvious.",[18,27,28],{},"Pick a key type. RSA 2048 is right for almost everyone.",[18,30,31,32,35],{},"Generate. Publish the TXT record at ",[22,33,34],{},"\u003Cselector>._domainkey.\u003Cdomain>",".",[18,37,38],{},"Install the private key on the signing server and keep it out of version control.",[18,40,41,42,45,46,49,50,53],{},"Send a test message and check that ",[22,43,44],{},"Authentication-Results"," shows ",[22,47,48],{},"dkim=pass header.d=yourdomain"," and ",[22,51,52],{},"header.s="," with your selector.",[10,55,57],{"id":56},"what-the-record-looks-like","What the record looks like",[59,60,65],"pre",{"className":61,"code":62,"language":63,"meta":64,"style":64},"language-txt shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","s2026._domainkey.example.com.  TXT  \"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...\"\n","txt","",[22,66,67],{"__ignoreMap":64},[68,69,72],"span",{"class":70,"line":71},"line",1,[68,73,62],{},[75,76,77,78,81,82,89],"p",{},"The ",[22,79,80],{},"p="," value is the public key in SubjectPublicKeyInfo form, base64 encoded. For Ed25519 it is the raw 32-byte key, as ",[83,84,88],"a",{"href":85,"rel":86},"https:\u002F\u002Fwww.rfc-editor.org\u002Frfc\u002Frfc8463",[87],"nofollow","RFC 8463"," specifies.",[75,91,92],{},"A 2048-bit key does not fit in a single 255-character TXT string. Most DNS panels split it for you. If yours does not, or you edit zone files directly, use the split version the generator shows. The strings are joined without spaces.",[10,94,96],{"id":95},"using-the-key-with-opendkim","Using the key with OpenDKIM",[59,98,102],{"className":99,"code":100,"language":101,"meta":64,"style":64},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Paste the private key the generator shows into the key file\nsudo mkdir -p \u002Fetc\u002Fopendkim\u002Fkeys\u002Fexample.com\nsudo nano \u002Fetc\u002Fopendkim\u002Fkeys\u002Fexample.com\u002Fs2026.private\nsudo chown opendkim:opendkim \u002Fetc\u002Fopendkim\u002Fkeys\u002Fexample.com\u002Fs2026.private\nsudo chmod 600 \u002Fetc\u002Fopendkim\u002Fkeys\u002Fexample.com\u002Fs2026.private\n\n# \u002Fetc\u002Fopendkim\u002FKeyTable\ns2026._domainkey.example.com example.com:s2026:\u002Fetc\u002Fopendkim\u002Fkeys\u002Fexample.com\u002Fs2026.private\n\n# \u002Fetc\u002Fopendkim\u002FSigningTable\n*@example.com s2026._domainkey.example.com\n","bash",[22,103,104,110,127,138,151,165,172,178,187,192,198],{"__ignoreMap":64},[68,105,106],{"class":70,"line":71},[68,107,109],{"class":108},"sHwdD","# Paste the private key the generator shows into the key file\n",[68,111,113,117,121,124],{"class":70,"line":112},2,[68,114,116],{"class":115},"sBMFI","sudo",[68,118,120],{"class":119},"sfazB"," mkdir",[68,122,123],{"class":119}," -p",[68,125,126],{"class":119}," \u002Fetc\u002Fopendkim\u002Fkeys\u002Fexample.com\n",[68,128,130,132,135],{"class":70,"line":129},3,[68,131,116],{"class":115},[68,133,134],{"class":119}," nano",[68,136,137],{"class":119}," \u002Fetc\u002Fopendkim\u002Fkeys\u002Fexample.com\u002Fs2026.private\n",[68,139,141,143,146,149],{"class":70,"line":140},4,[68,142,116],{"class":115},[68,144,145],{"class":119}," chown",[68,147,148],{"class":119}," opendkim:opendkim",[68,150,137],{"class":119},[68,152,154,156,159,163],{"class":70,"line":153},5,[68,155,116],{"class":115},[68,157,158],{"class":119}," chmod",[68,160,162],{"class":161},"sbssI"," 600",[68,164,137],{"class":119},[68,166,168],{"class":70,"line":167},6,[68,169,171],{"emptyLinePlaceholder":170},true,"\n",[68,173,175],{"class":70,"line":174},7,[68,176,177],{"class":108},"# \u002Fetc\u002Fopendkim\u002FKeyTable\n",[68,179,181,184],{"class":70,"line":180},8,[68,182,183],{"class":115},"s2026._domainkey.example.com",[68,185,186],{"class":119}," example.com:s2026:\u002Fetc\u002Fopendkim\u002Fkeys\u002Fexample.com\u002Fs2026.private\n",[68,188,190],{"class":70,"line":189},9,[68,191,171],{"emptyLinePlaceholder":170},[68,193,195],{"class":70,"line":194},10,[68,196,197],{"class":108},"# \u002Fetc\u002Fopendkim\u002FSigningTable\n",[68,199,201,205],{"class":70,"line":200},11,[68,202,204],{"class":203},"sMK4o","*",[68,206,208],{"class":207},"sTEyZ","@example.com s2026._domainkey.example.com\n",[75,210,211,212,215],{},"The generator outputs PKCS#8 PEM (",[22,213,214],{},"BEGIN PRIVATE KEY","), which OpenDKIM, Rspamd and most libraries such as Nodemailer accept.",[10,217,219],{"id":218},"security-notes","Security notes",[75,221,222,223,226,227,230],{},"Keys are generated with the browser's WebCrypto API and never leave the page. Even so, a key that has been displayed on screen and copied around is less private than one generated on the signing server with ",[22,224,225],{},"opendkim-genkey"," or ",[22,228,229],{},"openssl",". Use this generator for prototypes, test domains and servers where that trade-off is fine.",[232,233,234],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}",{"title":64,"searchDepth":112,"depth":112,"links":236},[237,238,239,240],{"id":12,"depth":112,"text":13},{"id":56,"depth":112,"text":57},{"id":95,"depth":112,"text":96},{"id":218,"depth":112,"text":219},"Free DKIM generator. Create an RSA or Ed25519 DKIM key pair in your browser and get the TXT record for \u003Cselector>._domainkey. Keys never leave the page.","md",[244,247,250,253],{"question":245,"answer":246},"Do I need this if my email provider handles DKIM?","No. Google Workspace, Microsoft 365 and most email APIs generate the key for you and give you the record to publish. This generator is for mail servers you run yourself, such as Postfix with OpenDKIM, or for testing.",{"question":248,"answer":249},"Which key size should I pick?","RSA 2048. It is the current recommendation and every verifier supports it. Use 1024 only when your DNS host cannot store a longer TXT record, and rotate away from it when you can.",{"question":251,"answer":252},"Should I use Ed25519?","Only alongside RSA. Ed25519 keys are short and fast, but many receivers still do not verify them. Sign every message twice, with an RSA selector and an Ed25519 selector.",{"question":254,"answer":255},"How often should I rotate DKIM keys?","Many teams rotate every six to twelve months. Publish the new key under a new selector, switch signing to it, and keep the old record until mail signed with it has been delivered and verified.","DKIM key generator","Pick a selector and key type, and the DKIM generator creates a key pair with WebCrypto in your browser. You get the TXT record to publish and the private key for your mail server. Nothing is sent to a server.",{},"\u002Ftools\u002Fdkim-generator",{"title":5,"description":241},"tools\u002Fdkim-generator","v3rDsRK6azTk04S4-lH9lCX1B_E-6rJw7qPi22rgv9E",1795555760325]