How to Fetch DKIM Records from DNS

By | 2012/10/27

DKIM is simply a TXT record in DNS. A simple host command can fetch this record. I’ll show you how!

The command is:

$ host -t TXT dkimrecord

So how do you find that dkim value?

DKIM records are in the following format:


The selector and domain are provided in the email headers of an email. For example, here is a portion of an email header from a gmail to gmail email.

The d= is the domain, the s= is the selector.

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113;

Here is an example DNS query. Here I am looking up gmail’s DKIM record:

$ host -t txt descriptive text "k=rsa\; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1Kd87/UeJjenpabgbFwh+eBCsSTrqmwIYYvywlbhbqoo2DymndFkbjOVIPIldNs/m40KF+yzMn1skyoxcTUGCQs8g3FgD2Ap3ZB5DekAo5wMmk4wimDO+U8QzI3SD0" "7y2+07wlNWwIt8svnxgdxGkVbbhzY8i+RQ9DpSVpPbF7ykQxtKXkv/ahW3KjViiAH+ghvvIhkx4xYSIc9oSwVmAl5OctMEeWUwg8Istjqz8BZeTWbf41fbNhte7Y+YqZOwq1Sd0DbvYAD9NOZK9vlfuac0598HY+vtSBczUiKERHv1yRbcaQtZFh5wtiRrN04BLUTD21MycBX5jYchHjPY/wIDAQAB"

A useful website for checking and analyzing DKIM records is:

One thought on “How to Fetch DKIM Records from DNS

  1. Smitha297

    This kind of game gives a real experience of building a farm and planting trees. afcbdgaedgbagded


Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.