---
title: "Email DNS checks"
description: "SPF, DMARC, DKIM and null MX checks on the domains of your verified DAST targets, read once a day from public DNS."
keywords: ["SPF", "DMARC", "DKIM", "null MX", "email spoofing", "SPF lookup limit", "email security", "DNS"]
---

For each [DAST target](/configuration/dynamic-scanning) whose **ownership you
have verified** (the same gate as
[Certificate Transparency monitoring](/configuration/certificates#certificate-transparency-monitoring)),
TRUSTIVAN reads the mail records of the host's **registrable domain** once a
day: `app.example.co.uk` is checked as `example.co.uk`, using the public suffix
list. Two verified hosts of one domain are one domain checked. Only TXT and MX
records are asked for, from the deployment's DNS resolver (the first
`nameserver` in `/etc/resolv.conf`, the same one the CAA lookup uses); no mail
is sent and nothing is sent to a mail server. A name typed into the settings is
never looked up as a domain.

## The checks

| Check | Fails when | Severity |
|---|---|---|
| `email-spf-missing` | The domain has MX records and no TXT record starting with `v=spf1`. | Medium |
| `email-spf-permissive` | The SPF record ends in `+all` (or a bare `all`); or in `?all`, has no `all` term (a `redirect=` target's `all` counts), authorizes an `ip4` range wider than /16 or an `ip6` range wider than /32. | High for `+all`, medium otherwise |
| `email-spf-invalid` | More than one SPF record; more than 10 DNS-querying terms (`include`, `a`, `mx`, `ptr`, `exists`, `redirect`) counted through every include and redirect (RFC 7208 section 4.6.4); an include or redirect target with no SPF record or more than one; an include loop. | Medium |
| `email-dmarc-missing` | No single TXT record at `_dmarc.<domain>` starting with `v=DMARC1` with a valid `p` tag. | Medium |
| `email-dmarc-not-enforced` | The DMARC policy is `p=none`. | Medium |
| `email-dmarc-no-reporting` | The DMARC record has no `rua` (aggregate report) address. | Low |
| `email-dkim-missing` | A selector **you listed** has no key at `<selector>._domainkey.<domain>`, or its `p=` is empty (revoked). | Medium |
| `email-no-mail-hardening` | The domain has no MX record and sends no mail (no SPF, or SPF of `v=spf1 -all` only) but does not publish both a null MX record (`MX 0 .`, RFC 7505) and `v=spf1 -all`. | Low |

A domain that has no MX record but publishes an SPF record with senders is
treated as sending mail only; it gets no MX finding.

### DKIM selectors

TRUSTIVAN cannot know which selectors a domain signs with, so it does not
guess. Under **Certificates → Email DNS → DKIM selectors** (or
`PUT /api/v1/certificates/settings` with `"email": {"dkim_selectors": [...]}`,
at most 20) list the selectors your mail providers use; each one without a key
is a finding. With none listed, TRUSTIVAN looks only at a short list of common
selectors (`default`, `dkim`, `google`, `k1`, `mail`, `s1`, `s2`, `selector1`,
`selector2`) and reports the ones it **finds**, labelled "common". A common
selector that is not there is never a finding.

## Findings and alerts

Each failed check is a `misconfiguration` finding on an `email_domain` asset
per domain (identity `email://<domain>`), through the usual lifecycle: it
resolves at the first read that no longer fails it. A new high finding
(`email-spf-permissive` with `+all`) is announced to the destinations that
receive new critical or high findings; the others show on **Findings** without
an announcement, as with other medium and low findings. When every verified
target of a domain is deleted or loses verification, the domain stops being
checked and its asset is archived.

A read that cannot complete (resolver unreachable, SERVFAIL, timeout, a
truncated answer) judges nothing: the domain keeps its last report and its
findings, and the console shows why the read failed. Each hourly pass reads at
most 20 domains per organization, longest-waiting first.

## Where it shows

**Certificates → Email DNS** lists each domain, when it was last read, a
summary of its records (MX, SPF with its lookup count, DMARC policy, DKIM keys
found) and its problems. `GET /api/v1/certificates/email-dns` (`assets:read`)
returns the same, with the full report of the last completed read.

## Limits

- Only the registrable domain is checked, not each subdomain (a subdomain's own
  SPF record, or DMARC `sp=`, is not judged).
- SPF macros (`%{...}`) are counted as one lookup and not expanded; the void
  lookup limit and `exp=` are not checked.
- Queries go over UDP only; a TXT answer too large for UDP is reported as a
  failed read rather than retried over TCP.
- DKIM key strength is not judged, only presence.
- DNSSEC, MTA-STS, TLS-RPT and BIMI are not checked.

## What is verified, and how

Every check is tested against an in-memory resolver (healthy domain, each
failure, the 10-lookup boundary at 10 and 11, include loops and a diamond of
includes that is not a loop, null MX and null SPF combinations, failed
lookups) and the UDP resolver against a local DNS server. The sweep is tested
end to end against a database: only verified domains are read, findings are
filed with their severities and resolved when the records are fixed, a failed
read keeps the last report, and a lapsed verification archives the asset. No
check has been run against live DNS in these tests.
