Bridge CDN
On this page

What a DKIM record does

DKIM (DomainKeys Identified Mail, RFC 6376) works in two halves. Your mail provider signs each outgoing message with a private key it keeps. The signature header names your domain (d=example.com) and a selector (s=sel1). The receiving server then looks up sel1._domainkey.example.com, reads the public key there and checks the signature.

Simple idea. Fiddly in practice. If the key matches, the message wasn't altered and really came from a sender you authorised. That result feeds into DMARC, which is why DKIM and DMARC are usually set up together.

Before you start

Here's how to add DKIM record values without breaking mail that's already flowing. Have these ready:

  • The DKIM selector and value from your mail provider. Google Workspace, Microsoft 365 and most sending platforms show them in their admin console.
  • The record type they ask for. Some providers give a TXT record with the key. Others give a CNAME that points at a key they host and rotate for you.
  • Access to the zone in Bridge DNS.

Don't switch signing on first. Many providers have a "start authenticating" button. Press it only after the DNS record is published. Otherwise you'll sign mail with a key nobody can find, and DKIM fails until the record appears.

How to add DKIM record values in Bridge DNS

  1. Open your zone and choose Add record.
  2. Pick the type your provider names: TXT for a key, CNAME for a hosted key.
  3. In the name field, enter sel1._domainkey, using your provider's selector instead of sel1. If your provider shows the full name, sel1._domainkey.example.com, drop the domain part. Otherwise you'll end up with the domain twice.
  4. Paste the value exactly. For TXT, it starts with v=DKIM1; and contains p= followed by the key.
  5. Save. Bridge DNS serves the record within seconds. Auto TTL resolves to 60 seconds for A, AAAA, and CNAME records and 120 seconds for every other record type.
  6. Return to your provider's console and turn on signing.

Mail records are never proxied in Bridge DNS, so there's nothing else to switch.

A DKIM DNS record example

A TXT key record:

sel1._domainkey  120  IN  TXT  ( "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx3..."
                                  "...rest-of-the-key...IDAQAB" )

A hosted key via CNAME:

sel1._domainkey  60  IN  CNAME  sel1.dkim.example.net.

A 2048-bit RSA key is about 400 characters long. A single DNS text string can hold only 255, so the value travels as two or more strings that receivers join back together. Some editors split long values for you.

How to check that DKIM works

First, confirm the record is published:

dig sel1._domainkey.example.com TXT +short

Run dig against the exact name. You should see the full v=DKIM1 value. For a CNAME setup, query CNAME instead, then the target's TXT.

Then send a message to an external mailbox and open the original headers. Look for the Authentication-Results line:

Authentication-Results: mx.example.org;
    dkim=pass header.d=example.com header.s=sel1

dkim=pass with your domain in header.d means the signature verified. That's the only check that proves the whole chain works. Nothing else does. A record that looks right in DNS can still fail if the provider signs with a different selector.

Why a DKIM record doesn't validate

These are the failures we see most:

  • Domain doubled in the name. The record sits at sel1._domainkey.example.com.example.com. Query the exact name to spot it.
  • Truncated or broken key. A missing character at the end of p=, or a line break pasted into the middle. Copy the value again in one piece.
  • Wrong selector. The provider signs with s=google while you published sel1. The header shows the selector actually used.
  • TXT and CNAME on the same name. A CNAME can't share its name with any other record. Keep only the type your provider asked for.
  • Signing turned on too early. Mail sent before the record existed fails. New mail passes once the record is live.
  • dkim=fail (body hash did not verify). The DNS is fine. Something changed the message after signing, often a mailing list footer or a security gateway.

Rotating or rolling back a DKIM key

To rotate a key, publish the new selector first, switch signing to it at your provider, and keep the old record for about a week. Mail already in queues may still be checked against it. Then delete the old selector.

To undo a fresh setup, turn signing off at the provider before you delete the record. Deleting first makes every signed message fail DKIM until signing stops.

DKIM and DMARC

DKIM proves a message is intact. DMARC tells receivers what to do when checks fail, and its alignment rule requires the DKIM domain to match the domain in the From address that people actually see in their inbox, so a provider signing as its own domain won't help you. Once dkim=pass shows up, add a DMARC record. If you haven't published SPF yet, set up SPF too. The email DNS overview shows how the records fit together, and the TXT record reference covers string limits.

DKIM setup questions

How do I add a DKIM record to my DNS?

Create a TXT or CNAME record named selector._domainkey with the value your mail provider gives you. That's how to add DKIM record values at any DNS host. Publish it before turning on signing, then check a test message for dkim=pass.

How to add DKIM record for Office 365?

Microsoft 365 uses two CNAME records, selector1._domainkey and selector2._domainkey, pointing at targets shown in the Defender portal. Add both as CNAMEs in Bridge DNS, then enable DKIM signing for the domain in Microsoft's portal.

Should a DKIM record be TXT or CNAME?

Use whichever your provider specifies. TXT holds the key directly. CNAME points at a key the provider hosts, which lets them rotate keys without you editing DNS.

Can I have more than one DKIM record?

Yes. Each selector is its own name, so several services can sign for the same domain. Each one needs its own selector.

How long does a new DKIM record take to work?

In Bridge DNS it's served within seconds. If someone looked up the name before you created it, their resolver may cache the "not found" answer for a few minutes first.