# DMARC & SPF Checker: Bulk DKIM, MX & Deliverability Audit (`quanta1810/dmarc-spf-checker`) Actor

Bulk DMARC & SPF checker for domain or e-mail lists: SPF validity and 10-lookup limit, DMARC policy, DKIM, MX, plus a 0-100 score, top issue and plain-English summary per domain. Google/Yahoo bulk-sender flag. $0.50 per 1,000 domains; failed lookups free.

- **URL**: https://apify.com/quanta1810/dmarc-spf-checker.md
- **Developed by:** [Quan Ta](https://apify.com/quanta1810) (community)
- **Categories:** Developer tools, Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 domain checkeds

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

## DMARC & SPF Checker: Bulk DKIM, MX & Deliverability Audit

Paste a list of domains (or websites, or e-mail addresses) and get **one row per domain** that tells you whether its email is protected against spoofing and ready for the Gmail / Yahoo bulk-sender rules — with a **0–100 score, a grade, the one thing to fix first** and a plain-English summary.

Every domain is checked in a single pass:

| Area | What is checked |
|---|---|
| **SPF** | Record present, more than one record (permanent error), syntax, the `all` qualifier (`-all` / `~all` / `?all` / `+all`), **DNS lookups counted recursively** through every `include` / `redirect` against the RFC 7208 limit of 10, void lookups (limit 2), `ptr`, includes that are missing or loop |
| **DMARC** | Record at `_dmarc.<domain>` — or inherited from the organizational domain for subdomains (never from a public suffix such as `gov.uk`) — policy `p=` / `sp=`, `pct=`, `rua=` / `ruf=` report addresses, `adkim` / `aspf` alignment, syntax errors, multiple records |
| **MX** | MX hosts, **null MX** (RFC 7505), mail provider (Google Workspace, Microsoft 365, Proofpoint, Mimecast, Zoho…), domains that do not send or receive mail |
| **DKIM** | Common selectors probed (Google, Microsoft 365, Mailchimp, SendGrid, …) — keys found, key size (1024 vs 2048-bit), revoked and testing keys |
| **Result** | `score` 0–100, `grade` A–F, `topIssue`, `summary`, `issues` codes, `bulkSenderReady` |

Pure DNS: no browser, no proxy, no API key, nothing is sent to the domain. Answers come from public resolvers (Cloudflare 1.1.1.1, retry on Google 8.8.8.8), so a run gives the same result wherever it runs. Measured: **about 30 domains in 4–6 seconds** with 10 in parallel.

### Who is it for?

- **MSPs and IT consultants doing DMARC prospecting** — check a list of local businesses, sort by `grade`, open the conversation with the exact gap (`topIssue`: "DMARC policy is p=none…"). `mailProvider` tells you if they are on Google Workspace or Microsoft 365.
- **Cold-email and outbound teams** — check your own sending domains (and new lookalike domains) before warm-up: `bulkSenderReady`, `spfLookups` near 10, missing DKIM.
- **Agencies and web hosts** — audit every client domain at once, schedule a weekly run and catch the day someone adds an 11th SPF include.
- **AI agents and automations** — one flat row per domain with `summary` and `topIssue` in plain English and stable `issues` codes.

### Quick links

- [How to use](#how-to-use) · [Output example](#output-example-real-run-shortened) · [Issue codes](#issue-codes) · [Use with n8n, Make, Zapier, Google Sheets](#use-it-with-n8n-make-zapier-or-google-sheets) · [Pricing](#pricing) · [FAQ](#faq)

### How to use

1. Add domains in **Domains, websites or e-mail addresses** — one per line. `example.com`, `https://www.example.com/contact` and `sales@example.com` all become `example.com` (counted once). A leading `www.` is dropped; other subdomains such as `mail.example.com` are checked as typed.
2. (Optional) Or point **…or domains from a dataset** at the results of another Actor (for example a Google Maps or lead scraper): the `domain`, `email`, `emails`, `website` or `url` field of each row is used.
3. (Optional) Add your own DKIM selector in **DKIM selectors to probe** if you know it.
4. Click **Start**. Download the results as **CSV, Excel, JSON** or use the API. The dataset has ready-made views: **Overview**, **SPF details**, **DMARC details** and **Not checked**.

#### Input example

```json
{
  "domains": ["google.com", "github.com", "sales@example.com", "https://www.microsoft.com/"],
  "checkDkim": true,
  "dkimSelectors": ["google", "selector1", "selector2", "default", "k1", "s1", "s2"]
}
```

#### Output example (real run, shortened)

`github.com`, checked on 19 November 2026 (arrays shortened):

```json
{
  "input": "github.com",
  "url": "github.com",
  "status": "ok",
  "charged": true,
  "errorCode": null,
  "domain": "github.com",
  "score": 91,
  "grade": "A",
  "summary": "Grade A (91/100). SPF valid (~all, 10/10 lookups); DMARC p=quarantine, reports on; MX Microsoft 365; DKIM google/2048-bit, selector1/1024-bit, k1/1024-bit, s1/2048-bit, s2/2048-bit. Fix first: 10 of 10 DNS lookups used — adding one more service will break SPF.",
  "topIssue": "10 of 10 DNS lookups used — adding one more service will break SPF",
  "issues": ["SPF_LOOKUPS_NEAR_LIMIT", "DKIM_1024_BIT_KEY", "SPF_SOFTFAIL_ALL"],
  "bulkSenderReady": true,
  "spfRecord": "v=spf1 ip4:192.30.252.0/22 include:spf.protection.outlook.com include:_netblocks.google.com … include:sendgrid.net … ~all",
  "spfValid": true,
  "spfAllQualifier": "~all",
  "spfLookups": 10,
  "spfVoidLookups": 0,
  "spfIncludes": ["spf.protection.outlook.com", "_netblocks.google.com", "…", "sendgrid.net"],
  "dmarcRecord": "v=DMARC1; p=quarantine; sp=reject; pct=100; rua=mailto:dmarc@github.com; ruf=mailto:dmarc@github.com; fo=1",
  "dmarcValid": true,
  "dmarcPolicy": "quarantine",
  "dmarcSubdomainPolicy": "reject",
  "dmarcEffectivePolicy": "quarantine",
  "dmarcPct": 100,
  "dmarcRua": ["dmarc@github.com"],
  "dmarcFoundAt": "github.com",
  "dmarcInherited": false,
  "hasMx": true,
  "nullMx": false,
  "mxHosts": ["github-com.mail.protection.outlook.com"],
  "mailProvider": "Microsoft 365",
  "dkimFound": ["google", "selector1", "k1", "s1", "s2"],
  "dkimKeys": [{ "selector": "google", "keyType": "rsa", "keyBits": 2048, "revoked": false, "testing": false }, "…"],
  "lookupTimeMs": 200
}
```

Each row also has `spfLookupsIncomplete`, `issueDetails` (code, severity, points, message for every issue), `dmarcRuf`, `dmarcAdkim`, `dmarcAspf`, `dkimSelectorsChecked` and `checkedAt`.

#### Status column

| `status` | Meaning | Charged? |
|---|---|---|
| `ok` | DNS answered for the domain — full result delivered (also when the domain has no SPF / DMARC at all: that IS the finding) | **Yes** |
| `unreachable` | The domain does not exist (`DOMAIN_NOT_FOUND`), or DNS failed after a retry on a second resolver (`DNS_TIMEOUT`, `DNS_SERVFAIL`, `DNS_REFUSED`, `DNS_ERROR`) | No |
| `invalid` | The input line is not a domain, website or e-mail address (`INVALID_INPUT`) — IP addresses and internal names included | No |
| `skipped` | Your **Max cost per run** was reached before this domain (`SKIPPED`) | No |
| `error` | Unexpected internal error (`INTERNAL_ERROR`) — please open an issue | No |

### Issue codes

The `score` starts at 100 and loses the points of every issue (at most 35 for SPF, 40 for DMARC, 10 for DKIM). Grade: **A** 90+, **B** 80+, **C** 65+, **D** 50+, **F** below 50. `topIssue` is the worst issue that needs action.

| Code | Severity | Points | Meaning |
|---|---|---|---|
| `SPF_MISSING` | high | 25 | No SPF record |
| `SPF_MULTIPLE_RECORDS` | high | 25 | More than one `v=spf1` record — SPF fails (permanent error) |
| `SPF_SYNTAX_ERROR` | high | 25 | Unknown term, bad IP / prefix, malformed include — SPF fails |
| `SPF_TOO_MANY_LOOKUPS` | high | 25 | More than 10 DNS lookups — SPF fails |
| `SPF_INCLUDE_NOT_FOUND` | high | 25 | An `include:` target has no (single) SPF record — SPF fails |
| `SPF_INCLUDE_LOOP` | high | 25 | Includes / redirects loop back — SPF fails |
| `SPF_REDIRECT_NOT_FOUND` | high | 25 | The `redirect=` target has no SPF record — SPF fails |
| `SPF_MX_TOO_MANY` | high | 25 | An `mx` term points at a name with more than 10 MX records — SPF fails |
| `SPF_PASS_ALL` | critical | 30 | `+all`: any server on the internet passes SPF |
| `SPF_NEUTRAL_ALL` | medium | 12 | `?all`: no protection |
| `SPF_NO_ALL` | medium | 10 | No `all` term (defaults to neutral) |
| `SPF_TOO_MANY_VOID_LOOKUPS` | medium | 10 | More than 2 lookups return nothing — many receivers fail SPF |
| `SPF_LOOKUP_FAILED` | medium | 5 | An include / redirect / `a` / `mx` lookup could not be resolved (timeout / server failure) — receivers may get a temporary error; `spfValid` and `bulkSenderReady` are then `null` (not verifiable) and `spfLookupsIncomplete` is `true` (`spfLookups` is a minimum) |
| `SPF_PTR_USED` | low | 3 | Uses the discouraged `ptr` mechanism |
| `SPF_LOOKUPS_NEAR_LIMIT` | low | 4 | 9 or 10 of 10 lookups used — one more service breaks SPF |
| `SPF_TERMS_AFTER_ALL` | low | 2 | Terms after `all` are never evaluated |
| `SPF_SOFTFAIL_ALL` | info | 2 | `~all` — fine together with an enforced DMARC policy |
| `DMARC_MISSING` | high | 35 | No DMARC record (none on the organizational domain either) |
| `DMARC_MULTIPLE_RECORDS` | high | 30 | More than one DMARC record — receivers ignore them all |
| `DMARC_SYNTAX_ERROR` | high | 30 | Malformed record (e.g. `v=DMARC1 p=reject` without `;`) — receivers ignore it |
| `DMARC_INVALID_POLICY` | high | 30 | `p=` missing or not none / quarantine / reject |
| `DMARC_POLICY_NONE` | medium | 20 | `p=none`: monitoring only, spoofed mail is delivered |
| `DMARC_TAG_ERROR` | medium | 8 | A tag has a bad value (`pct`, `rua` without `mailto:`, `adkim`…) |
| `DMARC_PCT_PARTIAL` | low | 5 | `pct` below 100: the policy covers only part of the failing mail |
| `DMARC_NO_RUA` | low | 5 | No `rua=` — no aggregate reports |
| `DMARC_SUBDOMAIN_POLICY_NONE` | low | 3 | `sp=none` while the domain enforces |
| `DKIM_WEAK_KEY` | high | 10 | RSA key shorter than 1024 bits |
| `DKIM_1024_BIT_KEY` | low | 3 | 1024-bit RSA key — 2048-bit recommended |
| `DKIM_TESTING_MODE` | low | 2 | Key published with `t=y` (testing) |
| `DKIM_NOT_FOUND` | info | 0 | No key on the selectors checked (DKIM may exist under another selector) |
| `NULL_MX` | info | 0 | Null MX: the domain accepts no email |
| `NO_MX` | info | 0 | No MX: the domain cannot receive email |
| `NO_MAIL_DOMAIN` | info | 0 | The domain neither sends nor receives email (parked) — should publish `v=spf1 -all` + DMARC `p=reject` |

### DMARC prospecting step by step

1. Get a list of businesses with their website or e-mail (an Apify Google Maps or lead scraper, a CRM export, a spreadsheet).
2. Run this Actor on the list (or pass the scraper's dataset ID).
3. Sort the **Overview** view by `score`; filter `grade` D / F or `dmarcEffectivePolicy` = `none`.
4. Use `topIssue` as the first line of your message and `mailProvider` to pick the right fix guide.

### Monitor every week

Save your list as a **task**, then add an Apify **Schedule** (for example every Monday 8:00). Connect the **Slack** or **email** integration, or a webhook, to be told when a domain's grade drops — for example after a new marketing tool adds an SPF include.

### Use it with n8n, Make, Zapier or Google Sheets

Every run produces a normal Apify dataset, so it works with all Apify integrations:

- **n8n** — Apify node: *Run an Actor* → *Get dataset items*, then send rows to Google Sheets, Airtable or your CRM.
- **Make / Zapier** — Apify app (Make: *Watch Actor Runs* / *Run an Actor*; Zapier: trigger *Finished Actor Run* / action *Run Actor*).
- **Google Sheets / Excel** — download the dataset as CSV / Excel, or push rows to a sheet after every run.
- **API (small lists)** — `POST https://api.apify.com/v2/acts/quanta1810~dmarc-spf-checker/run-sync-get-dataset-items?token=YOUR_TOKEN` with the input JSON returns the rows in one call (synchronous calls time out after 300 s).
- **API (bulk)** — `POST …/acts/quanta1810~dmarc-spf-checker/runs?token=YOUR_TOKEN`, then poll the run and read `GET …/datasets/{defaultDatasetId}/items`, or attach a webhook for *run succeeded*.

### Pricing

Pay only for results: **$0.0005 per domain** checked ($0.50 per 1,000 domains). There is no start fee, and the DKIM probes are included.

- A domain is charged when DNS answered for the domain itself — also when one of its SPF includes (a third-party name) did not resolve: the row is still delivered, with `spfValid: null` and `SPF_LOOKUP_FAILED` explaining what could not be verified.
- Domains that **do not exist**, whose **DNS fails** after a retry, **invalid** lines and **skipped** domains are listed with the reason but **not charged**.
- Set **Max cost per run** in the run options to cap your spend; the Actor checks as many domains as fit and lists the rest as `skipped`.
- On the Apify Free plan, the $5 monthly credit covers about 10,000 domains.

### Limits & notes

- **DKIM selectors cannot be listed through DNS.** Only the selectors in the input are probed; a key under another selector (Google Workspace keys published under a custom name, many ESPs) shows as `DKIM_NOT_FOUND` — that is why it costs no points. To find yours, look at `s=` in the DKIM-Signature header of an email you sent.
- **DNS only.** It reads what the domain publishes; it does not send email, so it cannot confirm that your messages are actually DKIM-signed or aligned. `bulkSenderReady` covers the DNS part of the Gmail / Yahoo rules (valid SPF + a DMARC policy).
- DMARC for subdomains: when `_dmarc.<subdomain>` has no record, the parent domains are tried one label at a time up to the **organizational domain**, computed from the Public Suffix List (bundled copy, version 2026-11-17) exactly like Gmail and Yahoo do. Policies published on a public suffix (`_dmarc.gov.uk`, `_dmarc.nhs.uk`) or marked `psd=y` never count as a domain's own DMARC. `dmarcInherited` and `dmarcFoundAt` show where the policy came from.
- SPF macros (`%{i}`) and `exists:` terms are counted as lookups but cannot be resolved ahead of time.
- Each DNS query has a timeout (default 5 s) and is retried on the second resolver (a timeout gets one more try); a domain gets at most about 45 seconds in total (then it is listed as `DNS_TIMEOUT`, not charged).
- Records longer than 2,000 characters are cut in the `spfRecord` / `dmarcRecord` columns (the checks use the full record).

### FAQ

**Is this a bulk DMARC checker?** Yes — paste hundreds or thousands of domains; each one gets its DMARC record, policy, report addresses and the issues found.

**Does it count SPF DNS lookups (the "too many DNS lookups" / PermError)?** Yes — every `include`, `a`, `mx`, `ptr`, `exists` and `redirect` is counted recursively through nested includes, exactly as receivers count them, against the limit of 10.

**Is it an SPF record checker too?** Yes — SPF syntax, multiple records, `+all` / `?all` / `~all` / `-all`, void lookups and dead includes are all checked.

**Does it check DKIM?** It probes common DKIM selectors and reports the key size. See the limits above for why a missing key is not always a problem.

**Does my domain meet the Google and Yahoo 2024 bulk sender requirements?** `bulkSenderReady` is true when SPF is valid and a DMARC policy is published — the DNS part of those rules. DKIM signing and alignment have to be confirmed on a real message.

**Can I use it for email deliverability checks before a cold-email campaign?** Yes — check your sending and lookalike domains: SPF lookups near the limit, `p=none`, missing reports and 1024-bit DKIM keys all show up.

**Which mail provider does a company use?** `mailProvider` is read from the MX records (Google Workspace, Microsoft 365, Proofpoint, Mimecast, Zoho, …, Self-hosted, Other).

**Can I schedule it?** Yes — use Apify Schedules to run it daily, weekly or monthly.

**Can I use it from code / Make / Zapier / n8n?** Yes, through the Apify API and integrations; every run returns a normal dataset.

**Why was a domain not charged?** Only domains where DNS answered are charged. Non-existent domains, DNS failures, invalid and skipped lines are free — see the `status` column.

**Found a bug or need another check (BIMI, MTA-STS…)?** Open an issue on the Actor's Issues tab — requests are welcome.

### Support & changelog

Issues opened on the **Issues** tab are answered within 2 business days.

- **0.1.0 (November 2026)** — first release.

# Actor input Schema

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

One per line: bare domains (example.com), websites (https://www.example.com/contact) or e-mail addresses (sales@example.com) — each becomes its domain. A leading www. is dropped; other subdomains (mail.example.com) are checked as typed. Duplicates are removed automatically.

## `datasetId` (type: `string`):

Optional: ID of an Apify dataset (for example Google Maps or lead-scraper results). The first of the fields domain / email / emails / website / url found in each row is used.

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

Probe the DKIM selectors below (<selector>.\_domainkey.<domain>) and report the keys found with their size. DNS cannot list selectors, so a key under another selector is not found. Included in the price.

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

Selectors to try (max 20). Defaults cover Google Workspace (google), Microsoft 365 (selector1, selector2), common hosts (default, k1 = Mailchimp, s1 / s2 = SendGrid). Add your own ESP's selector if you know it.

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

Stop after this many domains — handy for a quick test on a big list.

## `maxConcurrency` (type: `integer`):

How many domains to check at the same time.

## `dnsTimeoutSecs` (type: `integer`):

Give up on one DNS query after this many seconds; a failed or timed-out query is retried once on the second resolver. A domain whose DNS never answers is reported as unreachable and not charged.

## `dnsServers` (type: `array`):

Public resolvers to ask, in order (max 3): IPv4 / IPv6 addresses, or "system" for the resolver of the machine the run is on. The second one is used for the retry. Default: Cloudflare 1.1.1.1, then Google 8.8.8.8 — the same answers every run, wherever it runs.

## Actor input object example

```json
{
  "domains": [
    "google.com",
    "github.com",
    "microsoft.com",
    "openbsd.org",
    "example.com"
  ],
  "checkDkim": true,
  "dkimSelectors": [
    "google",
    "selector1",
    "selector2",
    "default",
    "k1",
    "s1",
    "s2"
  ],
  "maxItems": 0,
  "maxConcurrency": 20,
  "dnsTimeoutSecs": 5,
  "dnsServers": [
    "1.1.1.1",
    "8.8.8.8"
  ]
}
```

# Actor output Schema

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

No description

## `overview` (type: `string`):

No description

# 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": [
        "google.com",
        "github.com",
        "microsoft.com",
        "openbsd.org",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("quanta1810/dmarc-spf-checker").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": [
        "google.com",
        "github.com",
        "microsoft.com",
        "openbsd.org",
        "example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("quanta1810/dmarc-spf-checker").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": [
    "google.com",
    "github.com",
    "microsoft.com",
    "openbsd.org",
    "example.com"
  ]
}' |
apify call quanta1810/dmarc-spf-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,quanta1810/dmarc-spf-checker"
        }
    }
}
```

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/mVMzpt5ans7okK420/builds/cmVbIohCmzeWPjCz4/openapi.json
