Generate a DKIM public/private key pair and ready-to-publish DNS TXT record in seconds
| Domain: | |
| Selector: | |
| Key Length: |
DKIM signs every outgoing message with a cryptographic key, giving receiving servers proof that the email is genuine and arrived unmodified. The generator above creates everything you need in one click.
1024-bit RSA keys are considered weak and are rejected by Gmail and other major receivers. 2048-bit is the recommended standard. 4096-bit keys offer stronger security but can hit DNS TXT record length limits - use 2048-bit unless you have a specific reason to go higher.
Your selector identifies which public key to use. Pick something meaningful like the year (2026), service name (sendgrid), or purpose (marketing). This makes key rotation easier - you can run multiple selectors simultaneously, one per sending service.
DKIM signs a hash of the message headers and body. If anything modifies the message after signing - an ESP appending a footer, a gateway rewriting headers - the signature will fail. Make sure signing happens as the final step before the message leaves your infrastructure.
mail, 2026, or your ESP's name)selector._domainkey.yourdomain.com and wait for propagationDKIM records are a critical layer of security against email spoofing. Spoofing is when malicious actors disguise their sending address to appear as a trusted source. DKIM uses cryptography to verify the legitimacy of the sender, ensuring the message truly originated from the claimed domain.
When a DKIM-enabled mail server sends a message, it adds a digital signature to the email header using a private key held by the sender. The corresponding public key is published as a TXT record in the domain's DNS, making it accessible to any receiving server that needs to verify the signature.
When an email arrives, the receiving server retrieves the sender's public key from DNS and uses it to verify the signature. A successful match confirms the email came from an authorized source and was not modified in transit - significantly reducing the risk of spoofing and phishing attacks.
Once you have it set up, it's time to test it with our very own Email Tester.

| TAG | MEANING |
|---|---|
| v | This tag specifies the DKIM version being used. Currently the most common value is v=DKIM1. |
| a | This tag identifies the cryptographic algorithm used to generate the digital signature. A common value is rsa-sha256. |
| d | This tag indicates the domain name used with the selector to locate the sender's public key in DNS. |
| s | This tag specifies the selector record name used to find the public key. It is a subdomain label created by the sender for DKIM purposes (e.g., mail._domainkey.example.com). |
| c | This tag specifies the canonicalization method applied to headers and body before signing. Common values are relaxed/relaxed and simple/simple. |
| h | This tag lists the email header fields included in the signature calculation. Headers not listed here are not protected by DKIM. |
| t | This tag specifies flags that modify DKIM behavior. Valid values include y for testing mode and s for strict subdomain handling. |
Are You Ready To Experience The Difference?
Become a part of the Campaign Cleaner community today, and join countless satisfied customers who have witnessed significant improvements in their email deliverability and campaign success. Don't let HTML issues hold you back; let Campaign Cleaner optimize your campaigns and boost your inbox rates.