DKIM stands for DOMAIN KEY IDENTIFIED MAIL (DKIM). By the help of DKIM sender creates a digital signature to sign mail. The sending mail transfer agent (MTA) generates the signature by using an algorithm applied to the content of the signed fields. This algorithm creates a unique string of characters, or a “hash value.”

It based on asynchronous encryption. In DKIM there are two keys:-
Public Key are stored at TXT record of the domain which is used as a sender address.
Private key are those key which are kept at server, and it is used to create a signature for each mail.
When a mail server recive mail it looks for public part by using DNS in TXT record. using the public key server verify the mail that mail is sent by the owner of the domain or not. If the authentication successfull then it show the mail like normal mail. But if authentications fail then, server put this mail into spam.