[Articles](https://mailglo.com/articles/)

For AI agents: [llms.txt, the index of guides and public pages](https://mailglo.com/llms.txt)

# DKIM

DKIM adds a signature to each message. Receivers check it against a public key published in your DNS under a selector, for example `s1._domainkey.example.com`.

## What matters

1. Each sending service signs with its own key and selector, given to you in its setup.
2. DNS cannot list your selectors. The public check shows the keys it finds. To check your own key, type the selector your email service gave you.
3. For DMARC, the signature must be for a domain that matches your From address, not only the service's own domain. That match is called alignment.

## DKIM and DMARC

The signing domain is the signature's `d=` value. Your DMARC record sets how closely it must match the domain in the From address:

- Relaxed, the default (`adkim=r`): both sit under the same main domain, normally the one you registered, such as `example.com`. Mail from `news.example.com` aligns with a signature for `example.com` or `mail.example.com`.
- Strict (`adkim=s`): both are exactly the same domain.

A message can carry several signatures; one that verifies and aligns is enough.

## In MailGlo

The domain's DNS records show known selectors. A DKIM change publishes a service's public key; with hosted records, MailGlo serves the key at the selector you delegate. Your sending service keeps the private key and signs your mail; MailGlo never holds private keys.

## Common questions

### How long should a DKIM key be?

For an RSA key, 2,048 bits. Signers must use at least 1,024 bits and should use 2,048 ([RFC 8301, section 3.2](https://www.rfc-editor.org/rfc/rfc8301#section-3.2)). The public check marks a shorter RSA key as one to replace. Publish the key record your sending service gives you at your DNS provider; most DNS providers split a long key into several strings for you.

### How do I make my own DKIM key?

Most sending services make the key for you. If you run your own mail server, make a 2,048-bit key pair. The free [DKIM key generator](https://mailglo.com/tools/dkim-generator/) makes it in your browser, so the private key never leaves your computer. Or run these two commands on your computer. The first writes the private key. The second prints the public key for the record's `p=` value.

```sh
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out dkim-private.pem
openssl pkey -in dkim-private.pem -pubout -outform DER | base64 | tr -d '\n'
```

Publish `v=DKIM1; k=rsa; p=<public key>` as a TXT record at `<selector>._domainkey.<your domain>`. Put the private key in your mail server's DKIM settings.

### Can I find every selector a domain uses?

Not from outside: DNS answers only for a name you ask about. Your DNS provider's record list and each sending service's settings show yours. The public check shows the keys it finds and checks any selector you type. Your DMARC reports can show other selectors used on the mail they cover.

### Does a message need every signature to pass?

No. One signature that verifies and aligns with your From address is enough for DMARC ([RFC 9989, section 4.4.1](https://www.rfc-editor.org/rfc/rfc9989#section-4.4.1)).

Last updated 2 Dec 2026: To check your own DKIM key, type the selector your email service gave you.

Found an error, or a question this page does not answer? Email support@mailglo.com.
