email_dns.py

A Python script to resolve email-related DNS records for a domain.

Example:

$ python email_dns.py cbarts.net
{
    "cbarts.net": {
        "mx": [
            {
                "exchanger": "mail.protonmail.ch.",
                "preference": "10"
            },
            {
                "exchanger": "mailsec.protonmail.com.",
                "preference": "20"
            }
        ],
        "spf": "v=spf1 a include:spf.protection.outlook.com -all",
        "dkim": [
            {
                "application": "not specified",
                "selector": "default",
                "type": "TXT",
                "value": "v=DKIM1; k=rsa; p=MIIBI...;"
            },
            {
                "application": "exchange",
                "selector": "selector1",
                "type": "CNAME",
                "value": "selector1-contoso-com._domainkey.contoso.onmicrosoft.com."
            },
            {
                "application": "exchange",
                "selector": "selector2",
                "type": "CNAME",
                "value": "selector2-contoso-com._domainkey.contoso.onmicrosoft.com."
            }
        ],
        "dmarc": "v=DMARC1; p=quarantine; adkim=s; aspf=s; fo=1; ri=3600;"
    }
}

Limitations

Applications with dynamic selector names will not be detected, e.g. smtp2go (s12345._domainkey.<domain>)

Description
A simple Python script to resolve all email-related DNS records for a domain
Readme 28 KiB
Languages
Python 100%