Setting Up DKIM

Essential steps to integrate DKIM for email security.

Setting Up DKIM
Adam Palicz
Apr 30, 2024

Understanding DKIM: Signing Your Emails for Security

DKIM (DomainKeys Identified Mail) adds a digital signature to your outgoing emails, acting like a unique identifier. This signature allows email servers to verify the email originated from your authorized sources, combating phishing and spoofing attempts.

A DKIM signature is a TXT record that is added to the site's DNS zone settings. The entry itself looks like this:

where v — DKIM version, always takes the value v=DKIM1;

k— key type, always k=rsa;

p— unique code that can be generated in the mailing service.

How Does DKIM Work?

Imagine sending a certified letter. The signature acts as proof that the letter came from you. Here's DKIM's email verification process:

  1. Signing the Email: Your Email Service Provider (ESP) adds a DKIM signature containing encrypted data about the sender and the email to your outgoing message.
  2. Verification at Recipient Server: The recipient's email server receives the email and checks for the DKIM signature.
  3. Public Key Lookup: The server searches for the public key (part of the DKIM record) published in your domain's DNS zone (refer back to the DNS section for understanding DNS records).
  4. Signature Validation: The public key is used to decrypt the DKIM signature and verify the information within.
  5. Verdict: If the verification is successful, the email is recognized as legitimate and delivered to the inbox. If not, it may be marked as spam.

How to Set Up DKIM

The specific steps might vary depending on your Email Service Provider (ESP), but here's a general guideline:

  1. Access your ESP Settings: Locate the DKIM settings or record generation section within your ESP's control panel.
  2. Generate a DKIM Record: Follow your ESP's instructions to generate a DKIM record. This record typically includes details like hostnames, selector values, and keys.
  3. Add the Record to your DNS Zone: In your domain registrar's control panel, create a new TXT record. Copy the specific details from your generated DKIM record into the corresponding fields and save your changes. (Refer back to the DNS section for a refresher on managing DNS records).

DKIM Verification

  • ESP Tools: Many ESPs offer built-in DKIM verification features.
  • Third-party Services: Services like MailTester allow you to send a test email and receive a report that includes DKIM verification status.

Benefits of DKIM:

  • Reduced Spam & Phishing: Makes it harder for malicious actors to impersonate your domain.
  • Improved Email Deliverability: Emails with valid DKIM signatures are more likely to reach inboxes.
  • Brand Reputation Protection: Protects your brand from being associated with spam or phishing attempts.

DKIM Troubleshooting Tips

  1. Incorrect Selector: If your DKIM isn't validating, double-check the selector used in your DNS record. The selector must match the one your email sending service uses to sign your emails.
  2. Public Key Mismatch: Verify that the public key in your DNS matches the key your email service provider uses. Any discrepancy will cause DKIM verification to fail.
  3. DNS Record Formatting: Ensure your DKIM TXT record is correctly formatted, including the correct use of semicolons and quotes. Incorrect formatting can prevent DKIM verification.
  4. Test Your DKIM Record: Use online DKIM record testing tools to verify that your DKIM record is valid and accessible. These tools can provide insights into what might be wrong with your DKIM setup.