# Bulk DNS Lookup & DMARC, SPF, DKIM Checker (`devdarfy/dns-email-security`) Actor

Bulk DNS lookup and email security check for a list of domains: MX, SPF, DMARC, DKIM, MTA-STS, BIMI, CAA and DNSSEC. One row per domain with a 0-100 score and plain-English findings. $2 per 1,000 domains.

- **URL**: https://apify.com/devdarfy/dns-email-security.md
- **Developed by:** [Volkan](https://apify.com/devdarfy) (community)
- **Categories:** Developer tools, SEO tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 domain auditeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**Bulk DNS lookup and email security checker** for a list of domains: MX and mail provider, SPF with its lookup count, DMARC policy, DKIM keys, MTA-STS, TLS-RPT, BIMI, CAA and DNSSEC. Every domain becomes one row with a 0-100 score, a letter grade and findings written in plain English.

- **What you get:** one row per domain with its A, AAAA, NS, SOA and MX records, the detected mail provider, parsed SPF, DMARC and DKIM results, the score, the grade and a list of findings.
- **What it costs:** $0.002 per domain, so **1,000 domains = $2**. Entries that are not domain names are skipped and not charged. The only other charge is the standard Apify start fee of $0.00005 per run (per GB of memory). Apify platform usage is included in the price.
- **What you need:** a list of domains (URLs and e-mail addresses are accepted and reduced to the domain). Standard DNS only: no API keys, no login, no WHOIS.

### Example output

A shortened row from a run with the default input (16 November 2026). Scores in that run: github.com 78 (B), cloudflare.com 95 (A), example.com 93 (A).

```json
{
  "domain": "github.com",
  "resolves": true,
  "mx": [
    {
      "exchange": "github-com.mail.protection.outlook.com",
      "priority": 0
    }
  ],
  "mailProvider": "Microsoft 365",
  "spf": {
    "valid": true,
    "all": "~all",
    "lookupCount": 10
  },
  "dmarc": {
    "policy": "quarantine",
    "subdomainPolicy": "reject",
    "pct": 100,
    "hasRua": true
  },
  "dkim": {
    "selectorsFound": [
      {
        "selector": "google",
        "keyType": "rsa",
        "keyBits": 2048
      },
      {
        "selector": "selector1",
        "keyType": "rsa",
        "keyBits": 1024
      }
    ]
  },
  "mtaSts": {
    "txtPresent": false,
    "mode": null
  },
  "dnssec": false,
  "emailSecurityScore": 78,
  "grade": "B",
  "findings": [
    {
      "code": "MTA_STS_MISSING",
      "severity": "low",
      "message": "No MTA-STS record. Sending servers cannot require TLS when delivering to this domain, so delivery can be downgraded to plain text."
    },
    {
      "code": "DNSSEC_NOT_SIGNED",
      "severity": "low",
      "message": "The zone has no DS record in its parent, so its DNS answers (including MX, SPF and DMARC) are not protected by DNSSEC."
    }
  ],
  "checkedAt": "2026-11-16T07:30:27.871Z"
}
```

The full row also has `a`, `aaaa`, `ns`, `soa`, `wwwCname`, the raw SPF and DMARC records, all DKIM selectors found, `tlsRpt`, `bimi`, `caa` and `lookupErrors`. Every field is described under Output below.

### What it is good for

- **Checking your own domains.** Run it on every domain your company owns, including parked ones and old brands, and see which can be spoofed today (no SPF, DMARC at `p=none`, SPF over the 10-lookup limit).
- **MSP and agency reports.** Audit a whole client portfolio in one run, sort by grade, and hand each client the findings for their domain. Schedule it monthly to catch changes.
- **Pre-sales technical signals.** For a list of prospect domains, see who runs Google Workspace, Microsoft 365, Proofpoint or Mimecast, who has DMARC enforced and who does not. Useful for email security, deliverability and IT services sales.
- **Deliverability checks before a migration or a new sending tool.** Find SPF records that are about to break when you add one more `include:`.

### Quick start

Press Start with the default input (three well-known domains). A typical real input:

```json
{
  "domains": ["acme.com", "https://www.acme.co.uk/contact", "billing@acme-payments.io"],
  "dkimSelectors": ["acme2024"],
  "checkTls": true
}
```

URLs and e-mail addresses are reduced to their domain; the mailbox part of an address is thrown away and never stored.

### Pricing

Pay per result: **$2.00 per 1,000 domains** ($0.002 per row). You pay only for domains returned in the dataset, including domains that turn out not to exist. Entries that are not domain names are skipped and not charged. Use `maxItems` to cap spend.

### Input

| Field | Default | Meaning |
|---|---|---|
| `domains` | (required) | Domain names, one per line. URLs and e-mail addresses are accepted; the domain is extracted, lower-cased and converted to punycode. Duplicates are removed. Entries that are not domain names are skipped, not charged, and listed in the `ERRORS` record of the run's key-value store. |
| `checkDkim` | `true` | Try 40 common DKIM selectors (google, selector1, selector2, default, k1, s1, s2, protonmail, fm1, mandrill, zoho and others). |
| `dkimSelectors` | `[]` | Up to 20 extra selectors to try on every domain. |
| `checkMtaStsPolicy` | `true` | If the MTA-STS TXT record exists, download `https://mta-sts.<domain>/.well-known/mta-sts.txt` and read its mode. |
| `checkTls` | `false` | Connect to port 443 of each domain and read the website certificate (issuer, dates, days left, number of names). Not part of the score. |
| `concurrency` | `20` | Domains audited in parallel (1-50). The Actor also slows itself down when the DNS resolver starts refusing or timing out. |
| `maxItems` | `0` | Stop after this many domains. 0 = whole list. Caps your spend. |

### Output

One dataset row per domain. Sections that could not be determined are `null`, never guessed.

| Field | Meaning |
|---|---|
| `domain`, `resolves` | The domain as audited (punycode) and whether it exists in DNS. A domain that does not exist (NXDOMAIN) is still returned as a row with `resolves: false`. |
| `a`, `aaaa`, `ns`, `soa`, `wwwCname` | Basic DNS records. |
| `mx`, `mailProvider` | MX records and the provider detected from the MX host names, `other` when no known provider matches, `none` when there is no MX or a null MX. |
| `spf` | `record`, `recordCount`, `valid`, `all` (`-all`, `~all`, `?all`, `+all` or `null`), `lookupCount` after following every `include` and `redirect`, direct `includes`, `redirect`, `errors`. |
| `dmarc` | `record` (mailbox names replaced by `[redacted]`), `policy`, `subdomainPolicy`, `pct`, `hasRua`, `hasRuf`, `reportDomains` (only the domains that receive reports, never the addresses), `alignment {dkim, spf}`, `inheritedFrom` (set when a subdomain uses its parent's record). |
| `dkim` | `selectorsFound [{selector, keyType, keyBits}]`, `checkedSelectors`, `wildcard`. |
| `mtaSts` | `txtPresent`, `mode` (`enforce`, `testing`, `none`), `policyFetched`, `mxCovered` (whether every MX host is listed in the policy). |
| `tlsRpt`, `bimi` | `{present}` and `{present, logoUrl}`. |
| `caa` | CAA records as text, e.g. `0 issue "letsencrypt.org"`. |
| `dnssec` | `true` when the zone has a DS record in its parent (signed delegation), `false` when it does not, `null` when the resolver gave no usable answer. Signatures are not validated. |
| `tls` | Only with `checkTls`: `issuer`, `validFrom`, `validTo`, `daysLeft`, `sanCount`, `trusted`, `error`. |
| `emailSecurityScore`, `grade` | 0-100 and A-F, see below. `null` for domains that do not exist. |
| `findings` | `[{code, severity, message}]`, most severe first. |
| `lookupErrors` | DNS questions that got no answer even after a retry. The checks that depend on them are left out of the score. |
| `checkedAt` | ISO timestamp. |

### How the score works

Points per check. A check that could not be determined (for example the DMARC lookup timed out, or no DKIM key was found under the selectors tried) is left out, and the score is the share of the remaining points, scaled to 100.

| Check | Max | How points are given |
|---|---|---|
| SPF | 30 | 15 for exactly one valid record, +10 for `-all` (8 for `~all`, 2 for `?all`), +5 for staying within 10 DNS lookups. `+all`, a missing record or several records give 0. |
| DMARC | 35 | 10 for a valid record, +20 for `reject` (15 for `quarantine`, 0 for `none`), +5 for a `rua` report address, -3 when `pct` is below 100. A subdomain that inherits its parent's record is scored on `sp`. |
| DKIM | 15 | 15 when a key is found, 8 when the only keys are RSA under 1024 bits. Not counted when no key is found. |
| MX | 5 | MX present, or a null MX that says the domain takes no mail. |
| MTA-STS | 8 | 3 for the TXT record, +5 for a policy in `enforce` mode (3 for `testing`). Only for domains that receive mail. |
| TLS-RPT | 2 | Record present. Only for domains that receive mail. |
| DNSSEC | 5 | Signed delegation (DS record present). |

Grades: **A** 90-100, **B** 75-89, **C** 60-74, **D** 40-59, **F** below 40. CAA and the website certificate appear as findings but do not change the score.

### What the findings mean

| Code | Severity | Meaning |
|---|---|---|
| `SPF_MISSING` | high | No SPF record: any server can claim to send for this domain without failing SPF. |
| `SPF_PLUS_ALL` | critical | `+all` authorizes every server on the internet. |
| `SPF_MULTIPLE_RECORDS` | high | More than one SPF record; receivers treat this as a permanent error. |
| `SPF_TOO_MANY_LOOKUPS` | high | More than 10 DNS lookups (RFC 7208); SPF fails with a permanent error at the receiver. |
| `SPF_INVALID` | high | Syntax errors, a broken `include`, or an include loop. |
| `SPF_SOFTFAIL_ALL` / `SPF_NEUTRAL_ALL` / `SPF_NO_ALL` | info / medium / medium | How the record treats servers it does not list. |
| `SPF_PTR_USED` | low | Uses the `ptr` mechanism, which RFC 7208 discourages. |
| `DMARC_MISSING` | high | No DMARC record on the domain or its parent. |
| `DMARC_POLICY_NONE` | medium | Monitoring only; spoofed mail is still delivered. |
| `DMARC_NO_RUA` | low | No aggregate report address, so failures go unseen. |
| `DMARC_PCT_PARTIAL` | low | The policy applies to only part of the failing mail. |
| `DMARC_SUBDOMAIN_POLICY_WEAKER` | low | `sp=none` leaves subdomains unprotected. |
| `DMARC_INHERITED` | info | A subdomain without its own record; the parent's record applies. |
| `DMARC_INVALID` / `DMARC_MULTIPLE_RECORDS` / `DMARC_SYNTAX_WARNING` | high / high / low | Broken or duplicate records, or tags that receivers ignore. |
| `DKIM_NOT_FOUND_COMMON_SELECTORS` | info | No key under the selectors tried. This does **not** mean DKIM is off. |
| `DKIM_WEAK_KEY` | high | RSA key shorter than 1024 bits. |
| `DKIM_WILDCARD` | info | The domain answers every selector name with a key, so the real selector cannot be identified. |
| `MX_MISSING` / `MX_NULL` | medium / info | No MX record, or a null MX declaring that the domain takes no mail. |
| `MTA_STS_MISSING` | low | Senders cannot require TLS when delivering to this domain. |
| `MTA_STS_POLICY_UNREACHABLE` | medium | TXT record exists but the policy file could not be read, so it has no effect. |
| `MTA_STS_NOT_ENFORCED` | low | Policy in `testing` or `none` mode. |
| `MTA_STS_MX_MISMATCH` | medium | An MX host is not covered by the policy; in `enforce` mode some senders will not deliver to it. |
| `TLS_RPT_MISSING` | info | No reports about TLS delivery failures. |
| `DNSSEC_NOT_SIGNED` | low | No DS record in the parent zone. |
| `CAA_MISSING` | info | Any certificate authority may issue certificates for this name. |
| `TLS_CERT_EXPIRED` / `TLS_CERT_EXPIRING_SOON` / `TLS_CERT_UNTRUSTED` / `TLS_UNREACHABLE` | critical / medium / high / info | Website certificate checks (only with `checkTls`). |
| `DOMAIN_NOT_FOUND` / `DNS_LOOKUP_FAILED` | high / high or medium | The domain does not exist, or some DNS questions got no answer. |

### Speed

Each domain takes roughly 55-70 DNS questions (most of them DKIM selector guesses). The Actor paces itself to the resolver: it speeds up while every answer arrives and halves its rate when the resolver refuses or times out. Measured locally on a home router as resolver: the default three domains in under 5 seconds, and a list of 200 well-known domains in 354 seconds (about 0.6 domains per second, the router forced the slowest pace). A faster resolver gives a faster run. Turning off `checkDkim` cuts the number of questions by about two thirds.

### Limits

- **DKIM is found by guessing selectors.** DNS has no way to list them. A domain that signs with a selector outside the list (and outside your `dkimSelectors`) shows no key, which is reported as information, not as a problem, and does not lower the score.
- **No WHOIS or RDAP.** Registrar, registration dates and "is this domain available" are not provided. Registry terms (for example Verisign's and PIR's) restrict high-volume automated queries, so this Actor does not make them.
- **DMARC parent lookup without the Public Suffix List.** For a subdomain without its own record, the Actor tries the parent: the last two labels, or the last three under common country-code suffixes such as `co.uk` or `com.au`. Private suffixes like `github.io` are not recognized.
- **DNSSEC means "signed delegation".** The Actor checks for a DS record in the parent zone; it does not validate signatures. If the resolver cannot answer DS questions, `dnssec` is `null`.
- **SPF lookup count** follows RFC 7208's 10-lookup rule for `include`, `a`, `mx`, `ptr`, `exists` and `redirect`. The separate limits on MX host lookups and void lookups are not checked.
- **No SMTP connections.** Whether the mail servers offer STARTTLS, and whether individual mailboxes exist, are not checked. No port scanning.
- Mail provider detection is a fixed table of about 30 providers; others show as `other`.
- Outbound HTTPS and TLS connections (MTA-STS policy, `checkTls`) are made only to public IP addresses; names that resolve to private, loopback or link-local addresses are not contacted.

### FAQ

**Does "DKIM not found" mean the domain does not sign its mail?**
No. Selectors cannot be listed from DNS, so the Actor can only try known names. If you know the selector (it is in the `DKIM-Signature: s=` header of any message from that domain), add it to `dkimSelectors`.

**Why is a domain with `p=reject` not graded A?**
The score covers more than DMARC: SPF strictness and lookup count, DKIM, MTA-STS, TLS-RPT and DNSSEC. Look at `findings` for what is missing.

**Why do some rows have `lookupErrors`?**
Some DNS servers answer slowly or refuse bursts of questions. Each question is retried, and a domain with errors is checked a second time. What still gets no answer is listed, and the checks that depend on it are left out of the score instead of being marked as missing.

**Do you store or return e-mail addresses?**
No. DMARC report addresses are reduced to their domain (`reportDomains`), and in the raw `dmarc.record` and CAA values the mailbox name is replaced by `[redacted]`. E-mail addresses pasted into `domains` are reduced to their domain.

**Does it send any e-mail or touch the domain's mail servers?**
No. It only reads public DNS records, plus at most one HTTPS request for the MTA-STS policy and, if you turn on `checkTls`, one TLS handshake with the domain's web server.

### More Actors from the same developer

| Actor | What it does | Price |
|---|---|---|
| [ATS Jobs API](https://apify.com/devdarfy/ats-jobs) | Greenhouse, Lever and Ashby job postings, with new-job alerts | $3 / 1,000 jobs |
| [Career Page Jobs Scraper](https://apify.com/devdarfy/jobposting-extractor) | schema.org JobPosting data from any careers page that publishes it | $4 / 1,000 jobs |
| [Government Jobs API](https://apify.com/devdarfy/gov-jobs) | USAJOBS and Swedish Arbetsförmedlingen (Platsbanken) job ads | $2 / 1,000 jobs |
| [Website Screenshot API](https://apify.com/devdarfy/render-api) | Full-page screenshots and URL to PDF for lists of URLs | $1 / 1,000 screenshots |
| [RSS Feed Reader & Parser](https://apify.com/devdarfy/rss-feed-reader) | RSS, Atom, RDF and JSON Feed to clean JSON, new items only | $1 / 1,000 items |
| [Companies House API](https://apify.com/devdarfy/uk-companies-house) | UK company lookup by number, search and new incorporations | $3 / 1,000 companies |

# Actor input Schema

## `domains` (type: `array`):

Domain names to audit, one per line, e.g. example.com. You can also paste URLs or e-mail addresses; the domain is extracted (a leading www. is dropped from URLs). Duplicates are removed. Entries that are not domain names are skipped, are not charged and are listed in the ERRORS record of the run's key-value store.

## `checkDkim` (type: `boolean`):

Try a list of common DKIM selectors (google, selector1, selector2, default, k1, s1, s2 and others) plus your own. DKIM selectors cannot be listed from DNS, so a domain that uses an unusual selector shows no key here even though it signs its mail.

## `dkimSelectors` (type: `array`):

Additional selector names to try on every domain, e.g. the selector your own mail platform uses. Up to 20.

## `checkMtaStsPolicy` (type: `boolean`):

When a domain publishes an MTA-STS TXT record, also download https://mta-sts.<domain>/.well-known/mta-sts.txt and read its mode (enforce, testing, none). One HTTPS request per domain that has the TXT record.

## `checkTls` (type: `boolean`):

Connect to port 443 of each domain and read the certificate: issuer, validity dates, days left and number of names. Adds one connection per domain and makes the run slower. The certificate does not change the email security score.

## `concurrency` (type: `integer`):

How many domains are audited at the same time (1-50).

## `maxItems` (type: `integer`):

Stop after this many domains, 0 = audit the whole list. You are charged per domain returned (pay per result), so this caps your spend.

## Actor input object example

```json
{
  "domains": [
    "github.com",
    "cloudflare.com",
    "example.com"
  ],
  "checkDkim": true,
  "checkMtaStsPolicy": true,
  "checkTls": false,
  "concurrency": 20,
  "maxItems": 0
}
```

# Actor output Schema

## `results` (type: `string`):

DNS and email security audit rows, one per domain

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domains": [
        "github.com",
        "cloudflare.com",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("devdarfy/dns-email-security").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "domains": [
        "github.com",
        "cloudflare.com",
        "example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("devdarfy/dns-email-security").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "github.com",
    "cloudflare.com",
    "example.com"
  ]
}' |
apify call devdarfy/dns-email-security --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devdarfy/dns-email-security"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/3v3o0YOmvK3xBcdyq/builds/8eWO5ejuDHUrkiYQR/openapi.json
