Skip to Content
Email Security API

Email Security Check1 Credit

Check a domain's SPF, DKIM, DMARC and the rest of its mail setup, graded A+ to F.

GET
/v1/email

The Email Security API checks a domain's whole mail setup in one call: MX and reverse DNS, SPF, DKIM, DMARC, BIMI, MTA-STS, TLS-RPT, DANE and DNSSEC. It runs 39 checks, each with a stable id, a state and a fix, grades the domain from A+ to F, and for each fix it can compute, returns the exact record to publish.

The query is a domain, or an email address or URL with one. A domain with no mail setup at all is still a 200, graded, with a fix for each check that fails; only a domain that does not exist is a 404.

Each call costs 1 credit. Results are cached for up to 10 minutes.

Authorization

See Authentication for details.

headerX-API-Key<token>

Provide your API key in an HTTP request header.

Query Parameters

domain*string

The domain to check, or an email address or URL with one

Length1 <= length
verbose?boolean

Return extra detail: totalElapsed, retries and params, plus each errors entry's detail when the lookup fails. For email, each check also has a verifyCommand (dig), and the report adds the SPF include tree with per-record lookup counts (spf.tree), every DKIM selector probed (dkim.selectorsProbed), each DKIM key record and the MTA-STS policy file as served.

Defaultfalse
checks?string

The sections to run, as a comma list of mx, spf, dkim, dmarc, bimi, mtasts, tlsrpt, dane, ptr, dnssec. Every one by default; one is the sub-check form, which costs the same 1 credit with a smaller body. The SMTP/STARTTLS probe (smtp) and DNSBL listings (blacklist) are not offered yet

selector?string

DKIM selectors to check, as a comma list of at most 10. Checked first, and a selector with no key fails. The common selector list is still probed unless dkimDiscovery=false

dkimDiscovery?boolean

Probe a list of common DKIM selectors, ordered by the provider the domain's MX and SPF point at. Off checks only the selectors given

Defaulttrue
fresh?boolean

Run the checks again instead of answering from the 10-minute cache

Defaultfalse
transport?string

Transport for the DNS queries to each zone's nameservers. With udp, an answer too large for UDP is asked again over TCP; tcp asks everything over TCP

Default"udp"
Value in"udp""tcp"

Response Body

Successful email report. A domain with no mail setup at all is a 200 too, graded, with a fix for every check that fails

application/json
  1. response
tool*string

Tool that generated this result

Value in"dns""domain""reverse""site""dnssec""ssl""email""redirect"
query*string

The original query string

requestId*|

Unique request identifier that generated this result

timestamp*string

UTC timestamp when the result was generated

elapsed*|

Time taken to generate the result in milliseconds

cached*boolean

Whether this result was served from cache

totalElapsed?|

Returned with verbose. Total time in milliseconds, including retries and any lookups this one made. For a cached result, the time to read it

retries?number

Returned with verbose. Number of retries before the answer, 0 for a cached result

params?

Returned with verbose. The query parameters you set that differ from their defaults

domain*string
organizationalDomain*|

The organizational domain the RFC 9989 tree walk found, or the domain itself

checksRequested*array<>

The sections this report ran

grade*|

A+ to F; null when no check could be scored

Value in"A+""A""B""C""D""F"null
score*|

The weighted mean of the category scores, 0-100

gradeCaps*array<>

The caps that applied to the grade

partial*boolean

A lookup failed, leaving some checks not-checked. A partial report is not cached

canBeSpoofed*|

Mail from the domain can be forged without being rejected: no DMARC policy of quarantine or reject applied in full, or SPF +all. Null when dmarc was not requested

acceptsMail*|

The domain can receive mail: MX hosts, or an address, and no null MX

sendsMail*|

The domain sends mail: its SPF authorizes an address, or a usable DKIM key was found

parked*|

Sends no mail and receives none

mailProvider*|

The provider receiving the domain's mail, named from its MX hosts

summary*

How many checks ended in each state

categories*
mx*|null
spf*|null
dkim*|null
dmarc*|null
bimi*|null
mtaSts*|null
tlsRpt*|null
dane*|null
dnssec*|null
checks*array<>

Every check the requested sections ran, passes included, in a fixed order

fixes*array<>

What to fix, most important first, with the record to publish where one can be computed

errors*array<>

Empty on a 200, including when the domain has no mail setup at all. On any other status, why the request failed. The HTTP status is in the response line only

Errors

See Errors for the response format.

invalid_request
A parameter is missing or not valid: an unknown check, a check not offered yet (smtp, blacklist), or more than 10 selectors.
400
invalid_query
The query is not a domain name, an email address or a URL with one.
400
authentication_failed
No API key was sent, or it could not be checked.
401
invalid_api_key
The API key is not valid.
401
api_key_expired
The API key has expired.
401
out_of_credits
The account has no credits left.
402
forbidden
The caller may not use this tool.
403
not_found
The domain does not exist.
404
rate_limited
The caller is over its rate limit; retry after the Retry-After header.
429
internal_error
An internal error on our side.
500
Example Request
curl -X GET 'https://api.dns.tools/v1/email?domain=github.com'
Example Response
{  "tool": "email",  "query": "github.com",  "requestId": "becf73a9-dd72-4dcc-a22a-499611fed3ab",  "timestamp": "2026-11-30T03:22:05.305Z",  "elapsed": 5510,  "cached": false,  "errors": [],  "domain": "github.com",  "organizationalDomain": "github.com",  "checksRequested": [    "mx",    "spf",    "dkim",    "dmarc",    "bimi",    "mtasts",    "tlsrpt",    "dane",    "ptr",    "dnssec"  ],  "grade": "A",  "score": 94,  "gradeCaps": [],  "partial": false,  "canBeSpoofed": false,  "acceptsMail": true,  "sendsMail": true,  "parked": false,  "mailProvider": "Microsoft 365",  "summary": {    "passed": 19,    "warnings": 9,    "failed": 0,    "notChecked": 0  },  "categories": {    "mx": {      "score": 100,      "passed": 5,      "warnings": 0,      "failed": 0,      "notChecked": 0    },    "spf": {      "score": 90,      "passed": 5,      "warnings": 2,      "failed": 0,      "notChecked": 0    },    "dkim": {      "score": 90,      "passed": 3,      "warnings": 1,      "failed": 0,      "notChecked": 0    },    "dmarc": {      "score": 100,      "passed": 6,      "warnings": 1,      "failed": 0,      "notChecked": 0    },    "transport": {      "score": 85,      "passed": 0,      "warnings": 4,      "failed": 0,      "notChecked": 0    },    "brand": {      "score": 100,      "passed": 0,      "warnings": 1,      "failed": 0,      "notChecked": 0    }  },  "mx": {    "records": [      {        "host": "github-com.mail.protection.outlook.com",        "priority": 0,        "ipv4": [          "52.101.50.13",          "52.101.194.164",          "52.101.42.165",          "52.101.202.144"        ],        "ipv6": [          "2a01:111:f403:f904::c",          "2a01:111:f403:f904::2",          "2a01:111:f403:c946::18",          "2a01:111:f403:f904::d"        ],        "alias": null,        "reverse": [          {            "address": "52.101.50.13",            "ptr": "mail-mw2pr02cu00605.inbound.protection.outlook.com",            "fcrdns": true          },          {            "address": "52.101.194.164",            "ptr": "mail-ch5pr04cu00204.inbound.protection.outlook.com",            "fcrdns": true          },          {            "address": "52.101.42.165",            "ptr": "mail-co2pr03cu00305.inbound.protection.outlook.com",            "fcrdns": true          },          {            "address": "52.101.202.144",            "ptr": "mail-ph8pr05cu00300.inbound.protection.outlook.com",            "fcrdns": true          },          {            "address": "2a01:111:f403:f904::c",            "ptr": "mail-ds0pr05cu00104.inbound.protection.outlook.com",            "fcrdns": true          },          {            "address": "2a01:111:f403:f904::2",            "ptr": "mail-ds2pr05cu00102.inbound.protection.outlook.com",            "fcrdns": true          },          {            "address": "2a01:111:f403:c946::18",            "ptr": "mail-ch5pr04cu00200.inbound.protection.outlook.com",            "fcrdns": true          },          {            "address": "2a01:111:f403:f904::d",            "ptr": "mail-dm2pr03cu00105.inbound.protection.outlook.com",            "fcrdns": true          }        ],        "dane": {          "status": "no-tlsa",          "tlsaName": "_25._tcp.github-com.mail.protection.outlook.com",          "dnssec": "indeterminate",          "records": [],          "rollover": null        }      }    ],    "nullMx": false,    "implicitMx": false,    "implicitAddresses": []  },  "spf": {    "record": "v=spf1 ip4:192.30.252.0/22 ip4:172.170.10.240/28 ip4:40.78.162.192/28 ip4:172.170.3.48/28 include:spf.protection.outlook.com include:_netblocks.google.com include:_netblocks2.google.com include:mail.zendesk.com include:_spf.salesforce.com include:servers.mcsv.net include:mktomail.com include:sendgrid.net ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131 ~all",    "records": 1,    "allQualifier": "~all",    "dnsLookups": 10,    "lookupLimit": 10,    "exceedsLookupLimit": false,    "voidLookups": 0,    "voidLookupLimit": 2,    "includes": [      "spf.protection.outlook.com",      "_netblocks.google.com",      "_netblocks2.google.com",      "mail.zendesk.com",      "_spf.salesforce.com",      "servers.mcsv.net",      "mktomail.com",      "sendgrid.net",      "ab.sendgrid.net"    ],    "authorizesAddresses": true,    "errors": []  },  "dkim": {    "selectorsProvided": [],    "selectorsChecked": 37,    "found": [      {        "selector": "selector1",        "name": "selector1._domainkey.github.com",        "keyType": "rsa",        "keyBits": 1024,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "s1",        "name": "s1._domainkey.github.com",        "keyType": "rsa",        "keyBits": 2048,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "s2",        "name": "s2._domainkey.github.com",        "keyType": "rsa",        "keyBits": 2048,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "smtpapi",        "name": "smtpapi._domainkey.github.com",        "keyType": "rsa",        "keyBits": 1024,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "k1",        "name": "k1._domainkey.github.com",        "keyType": "rsa",        "keyBits": 1024,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "k2",        "name": "k2._domainkey.github.com",        "keyType": "rsa",        "keyBits": 2048,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "k3",        "name": "k3._domainkey.github.com",        "keyType": "rsa",        "keyBits": 2048,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "zendesk1",        "name": "zendesk1._domainkey.github.com",        "keyType": "rsa",        "keyBits": 2048,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "zendesk2",        "name": "zendesk2._domainkey.github.com",        "keyType": "rsa",        "keyBits": 2048,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "google",        "name": "google._domainkey.github.com",        "keyType": "rsa",        "keyBits": 2048,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      },      {        "selector": "cm",        "name": "cm._domainkey.github.com",        "keyType": "rsa",        "keyBits": 1024,        "testing": false,        "revoked": false,        "valid": true,        "errors": [],        "provided": false      }    ],    "missing": [],    "wildcard": false  },  "dmarc": {    "record": "v=DMARC1; p=quarantine; sp=reject; pct=100; rua=mailto:dmarc@github.com; ruf=mailto:dmarc@github.com; fo=1",    "recordName": "_dmarc.github.com",    "inheritedFrom": null,    "policy": "quarantine",    "subdomainPolicy": "reject",    "nonexistentSubdomainPolicy": "reject",    "appliedPolicy": "quarantine",    "testing": false,    "pct": 100,    "psd": null,    "alignment": {      "dkim": "r",      "spf": "r"    },    "rua": [      {        "uri": "mailto:dmarc@github.com",        "domain": "github.com",        "external": false,        "authorized": null      }    ],    "ruf": [      {        "uri": "mailto:dmarc@github.com",        "domain": "github.com",        "external": false,        "authorized": null      }    ],    "removedTags": [      "pct"    ],    "errors": []  },  "bimi": {    "record": null,    "logo": null,    "authority": null,    "dmarcReady": true,    "logoCheck": null,    "certificate": null,    "errors": []  },  "mtaSts": {    "record": null,    "id": null,    "policyUrl": "https://mta-sts.github.com/.well-known/mta-sts.txt",    "policy": null,    "policyError": null,    "coversAllMx": null,    "errors": []  },  "tlsRpt": {    "record": null,    "rua": [],    "errors": []  },  "dane": {    "status": "no-tlsa",    "mxSigned": false,    "hostsTotal": 1,    "hostsWithTlsa": 0,    "hostsValidated": 0  },  "dnssec": {    "status": "insecure",    "signed": false  },  "checks": [    {      "id": "mx-records",      "section": "mx",      "category": "mx",      "name": "MX records",      "state": "ok",      "severity": "info",      "detail": "1 MX record: github-com.mail.protection.outlook.com (0).",      "fix": null,      "record": null    },    {      "id": "mx-resolves",      "section": "mx",      "category": "mx",      "name": "MX hosts resolve",      "state": "ok",      "severity": "info",      "detail": "Every MX host resolves (1 host).",      "fix": null,      "record": null    },    {      "id": "mx-targets",      "section": "mx",      "category": "mx",      "name": "MX targets",      "state": "ok",      "severity": "info",      "detail": "Every MX record names a host with its own address records.",      "fix": null,      "record": null    },    {      "id": "spf-record",      "section": "spf",      "category": "spf",      "name": "SPF record",      "state": "ok",      "severity": "info",      "detail": "v=spf1 ip4:192.30.252.0/22 ip4:172.170.10.240/28 ip4:40.78.162.192/28 ip4:172.170.3.48/28 include:spf.protection.outlook.com include:_netblocks.google.com include:_netblocks2.google.com include:mail.zendesk.com include:_spf.salesforce.com include:servers.mcsv.net include:mktomail.com include:sendgrid.net ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131 ~all",      "fix": null,      "record": null    },    {      "id": "spf-syntax",      "section": "spf",      "category": "spf",      "name": "SPF syntax",      "state": "ok",      "severity": "info",      "detail": "Every term parses.",      "fix": null,      "record": null    },    {      "id": "spf-lookups",      "section": "spf",      "category": "spf",      "name": "SPF DNS lookups",      "state": "warn",      "severity": "low",      "detail": "10 DNS lookups of 10. One more include will break SPF.",      "fix": "Trim includes for services that no longer send before adding another.",      "record": null    },    {      "id": "spf-all",      "section": "spf",      "category": "spf",      "name": "SPF all",      "state": "warn",      "severity": "low",      "detail": "The record ends in ~all (softfail): unlisted senders are only marked, not rejected.",      "fix": "Change ~all to -all once every sender is listed. With a DMARC policy of quarantine or reject, ~all is acceptable.",      "record": {        "type": "TXT",        "name": "github.com",        "value": "v=spf1 ip4:192.30.252.0/22 ip4:172.170.10.240/28 ip4:40.78.162.192/28 ip4:172.170.3.48/28 include:spf.protection.outlook.com include:_netblocks.google.com include:_netblocks2.google.com include:mail.zendesk.com include:_spf.salesforce.com include:servers.mcsv.net include:mktomail.com include:sendgrid.net ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131 -all"      }    },    {      "id": "dkim-key-strength",      "section": "dkim",      "category": "dkim",      "name": "DKIM key strength",      "state": "warn",      "severity": "medium",      "detail": "1024-bit keys: selector1, smtpapi, k1, cm. RFC 8301 asks for 2048.",      "fix": "Rotate to a 2048-bit RSA key.",      "record": null    },    {      "id": "dmarc-deprecated-tags",      "section": "dmarc",      "category": "dmarc",      "name": "DMARC removed tags",      "state": "warn",      "severity": "info",      "detail": "RFC 9989 removed pct; receivers following it ignore them.",      "fix": "Remove pct from the record.",      "record": null    },    {      "id": "dmarc-external-reports",      "section": "dmarc",      "category": "dmarc",      "name": "DMARC external report authorization",      "state": "not-applicable",      "severity": "info",      "detail": "Every report address is at the same organization.",      "fix": null,      "record": null    }  ],  "fixes": [    {      "check": "dkim-key-strength",      "severity": "medium",      "fix": "Rotate to a 2048-bit RSA key.",      "record": null    },    {      "check": "mtasts-record",      "severity": "low",      "fix": "Publish the record and serve a policy at https://mta-sts.github.com/.well-known/mta-sts.txt listing your MX hosts (start with mode: testing).",      "record": {        "type": "TXT",        "name": "_mta-sts.github.com",        "value": "v=STSv1; id=2026113001"      }    },    {      "check": "spf-lookups",      "severity": "low",      "fix": "Trim includes for services that no longer send before adding another.",      "record": null    },    {      "check": "spf-all",      "severity": "low",      "fix": "Change ~all to -all once every sender is listed. With a DMARC policy of quarantine or reject, ~all is acceptable.",      "record": {        "type": "TXT",        "name": "github.com",        "value": "v=spf1 ip4:192.30.252.0/22 ip4:172.170.10.240/28 ip4:40.78.162.192/28 ip4:172.170.3.48/28 include:spf.protection.outlook.com include:_netblocks.google.com include:_netblocks2.google.com include:mail.zendesk.com include:_spf.salesforce.com include:servers.mcsv.net include:mktomail.com include:sendgrid.net ip4:62.253.227.114 ip4:166.78.69.169 ip4:166.78.69.170 ip4:166.78.71.131 -all"      }    },    {      "check": "tlsrpt-record",      "severity": "low",      "fix": "Publish a TLS-RPT record so senders report TLS failures delivering to you.",      "record": {        "type": "TXT",        "name": "_smtp._tls.github.com",        "value": "v=TLSRPTv1; rua=mailto:tls-reports@github.com"      }    },    {      "check": "dmarc-deprecated-tags",      "severity": "info",      "fix": "Remove pct from the record.",      "record": null    },    {      "check": "bimi-record",      "severity": "info",      "fix": "Optional: publish a BIMI record pointing at an SVG Tiny PS logo (and a VMC or CMC for Gmail and Apple Mail), once DMARC is at quarantine or reject.",      "record": null    },    {      "check": "dane-tlsa",      "severity": "info",      "fix": "Optional: sign the MX hosts' zone with DNSSEC and publish a 3 1 1 TLSA record for each server's key (and a 2 1 1 for its issuer) at _25._tcp.<mx>.",      "record": null    },    {      "check": "dnssec-signed",      "severity": "info",      "fix": "Sign the zone with DNSSEC at your DNS provider and publish the DS record at your registrar. DANE needs it.",      "record": null    }  ]}