Querying SPF, DKIM and DMARC records

The table below shows the commands used in Windows Command Line, Linux Terminal and Mac OS Terminal to query for the SPF, DKIM and DMARC records for a domain.

Follow the instructions below and substitute the word selector and domain with the corresponding DKIM selector and domain you would like to look up.

Record Windows Commands Linux/Mac OS Commands
SPF nslookup -type=txt domain dig txt domain
DKIM nslookup -type=txt selector._domainkey.domain dig txt selector._domainkey.domain
DMARC nslookup -type=txt _dmarc.domain dig txt _dmarc.domain

Steps to query the command :

  1. Open Command prompt (Start > Run > cmd)
  2. Type “nslookup -type=txt” a space, and then the domain/host name. e.g. “nslookup -type=txt google.com”
  3. If an SPF record exists, the result would be similar to:
    “v=spf1 ip4:207.171.160.0/19 -all”
  4. If there are no results or if there is no “v=spf1” property, then there is a problem retrieving the record for the domain, or one does not exist.

Example 1 :

Querying the SPF record for progist.in using nslookup. nslookup -type=txt progist.in

 

Example 2 :
Querying the DKIM key for example.com using dig. You will have to know the DKIM selector – key (For Example) – being used in order to query for the DKIM key.dig txt key1._domainkey.example.com

Example 3:
Querying the DMARC record for progist.in using nslookup.nslookup – type=txt _dmarc.progist.in

Was this helpful?

1 / 0

Loved this article? Share it with your friends and followers.