What is DKIM and how to add a record
This topic explains what DKIM is and how to add a DKIM record to authenticate your emails.
Prerequisites
Before you begin, you may want to understand the following concept: What is DNS?
What is DKIM
DomainKeys Identified Mail (DKIM) is an email authentication method that helps detect email spoofing and tampering, thereby improving email security and trust. This technology lets a sender attach a digital signature to an email, verifying that the message originated from the claimed sending domain and was not altered in transit.
Get the record value
Log on to the management console as a mailbox administrator. Navigate to Domain > Domain Settings, and then click View Details.

Click Copy to get the DKIM record value.
NoteThe host record and record value are unique to each domain. Obtain the specific values from your email management console.
The encryption bit length can be 1024 or 2048. Choose the value supported by your domain management platform. Most platforms support both. If you switch the bit length, the old record value becomes invalid. Ensure you update your domain's dns settings with the latest record.
To apply the changes, navigate to another feature and then return to the Domain page. This action activates the server-side DKIM signing process.

Add the DKIM record
The following steps use the Alibaba Cloud DNS console as an example. If you use a different DNS provider, the procedure will be similar.
1. Log on to the Alibaba Cloud DNS console.
2. Click the domain to open the dns settings page.
3. On the Dns settings page, click the Add Record button to create a TXT record.
4. For the host record, enter default._domainkey.
5. For the record value, paste the value you copied, for example, v=DKIM1; g=*; k=rsa; p=....... Note that the entire record must be on a single line.
The following image shows an example of an added DKIM record:
How DKIM signing works
When an email is sent with DKIM enabled, the sending server adds a DKIM-Signature header to the message. This header contains verification information, including two key parts: the signature itself, generated with a private key, and a selector. The selector is a unique identifier used to locate the specific public key record in DNS.
Here is an example of a DKIM-Signature header in an email:
DKIM-Signature: v=1; a=rsa-sha256; d=example.com; s=default; c=relaxed/relaxed;
h=from:to:subject:date:message-id; i=@example.com;
bh=...; b=...;In this header:
v=1specifies the DKIM version.a=rsa-sha256specifies the signing algorithm.d=example.comspecifies the sending domain.s=defaultspecifies the selector used for the signature.c=relaxed/relaxedspecifies the canonicalization algorithm.h=from:to:subject:date:message-idlists the signed header fields.i=@example.comspecifies the signing identity.The value after
bh=is the hash of the email body.The value after
b=is the signature itself.
When a receiving server gets the email, it inspects the DKIM-Signature header to find the values for d= (the domain) and s= (the selector). These values tell the receiving server where to look up the corresponding public key in DNS.
The receiving server constructs a DNS query based on the sending domain (d=example.com) and the selector (for example, default). The query looks like this:
default._domainkey.example.comThe receiving server then queries this DNS record to retrieve the public key. It uses this public key to verify the signature in the b= tag. If the signature is valid, the email is considered authentic, verifying that it came from the claimed domain and was not altered in transit.
If a domain uses multiple sending sources, each source should use a different selector. This allows the receiving server to find the correct public key by using the selector in each email's DKIM-Signature header.