# Bulk DNS & Email Authentication Checker (SPF, DMARC, DKIM, MX) (`mossfetch/dns-email-auth-check`) Actor

Check SPF, DMARC, DKIM and MX for a list of domains. Returns one row per domain with a pass/warn/fail grade and the reasons, plus NS and A/AAAA records. Plain public DNS, no key. $1 per 1,000 domains; invalid names are free.

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

## Pricing

$1.00 / 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

## Bulk DNS & Email Authentication Checker (SPF, DMARC, DKIM, MX)

SPF checker, DMARC checker and DKIM probe for many domains at once: bulk email authentication audit with a pass/warn/fail grade. Use it when you need to audit email authentication or find missing or weak SPF and DMARC across many domains. Give it a list of domains. Get one row per domain with A/AAAA, NS, MX, SPF (parsed, top-level DNS-lookup count, `all` qualifier), DMARC (policy, pct, whether `rua` is present) and DKIM (12 common selectors), plus a pass/warn/fail grade with the reasons.

### Who it's for

- Email deliverability and security teams checking SPF and DMARC before a policy change.
- MSPs and agencies auditing the domains of many clients in one run.
- Sales and research teams who want to know which prospects have no or weak email authentication.

### Try it in one click

The input is prefilled with 3 domains (google.com, github.com, example.com). Press Start: it costs about $0.003.

### Input

| Field | Default | Notes |
|---|---|---|
| `domains` | required | Domains, URLs or emails (reduced to the domain) |
| `dkimSelectors` | 12 common selectors | Add your own selector names to probe them |
| `concurrency` | 25 | Domains checked in parallel, max 50 |
| `timeoutSecs` | 4 | Wait per DNS answer before marking it TIMEOUT |
| `dnsServers` | system resolver | Optional resolver IPs |

### Output (per domain)

`domain, grade, issues[], status (ok|partial|error), error (NXDOMAIN, TIMEOUT, INVALID_DOMAIN...), a, aaaa, ns, mx[], spf{}, dmarc{}, dkim{}`

Failures are per row: one bad domain never stops the run.

### Sample output

One real row from a run of the prefilled input (`github.com`):

```json
{
  "domain": "github.com",
  "status": "ok",
  "error": null,
  "grade": "pass",
  "issues": [],
  "a": [
    "140.82.114.4"
  ],
  "aaaa": [],
  "ns": [
    "dns1.p08.nsone.net",
    "dns2.p08.nsone.net",
    "dns3.p08.nsone.net",
    "dns4.p08.nsone.net",
    "ns-1283.awsdns-32.org",
    "ns-1707.awsdns-21.co.uk",
    "ns-421.awsdns-52.com",
    "ns-520.awsdns-01.net"
  ],
  "mx": [
    {
      "priority": 0,
      "host": "github-com.mail.protection.outlook.com"
    }
  ],
  "spf": {
    "found": true,
    "record": "v=spf1 ip4:192.30.252.0/22 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",
    "all": "~",
    "lookups": 8,
    "tooManyLookups": false,
    "multiple": false
  },
  "dmarc": {
    "found": true,
    "record": "v=DMARC1; p=quarantine; sp=reject; pct=100; rua=[redacted]; ruf=[redacted]; fo=1",
    "policy": "quarantine",
    "subdomainPolicy": "reject",
    "pct": 100,
    "ruaPresent": true
  },
  "dkim": {
    "selectorsChecked": 12,
    "selectorsFound": [
      "google",
      "selector1",
      "k1",
      "k2",
      "s1",
      "s2"
    ],
    "keyType": "rsa"
  }
}
```

### Grading

- fail: no SPF, multiple SPF, >10 top-level SPF lookups (nested includes are not expanded), `+all`, no DMARC, invalid DMARC policy
- warn: `?all`, DMARC `p=none`, pct<100, no `rua`, no MX, no DKIM at common selectors
- pass: none of the above

DKIM is only checked at common selectors; a custom selector will not be found.

### Data source and licence

Plain public DNS queries (A, AAAA, NS, MX, TXT) via the standard resolver. No websites are accessed. DNS data carries no licence. No WHOIS/RDAP. DMARC `rua`/`ruf` addresses are never output (only whether they exist), so no personal data is returned.

### Pricing

Pay per event: $1 per 1,000 domains checked. Invalid domain names are free. Example: 500 client domains cost $0.50.

### FAQ

**Why does a domain show "no DKIM key at common selectors"?** DKIM lives at a selector name only the sender knows. The actor probes 12 common ones (`default`, `google`, `selector1`, `selector2`, `k1`, `k2`, `mail`, `s1`, `s2`, `dkim`, `mandrill`, `smtp`). If the domain uses a custom selector, add it to `dkimSelectors`.

**Are DMARC report addresses (rua/ruf) shown?** No. They are redacted; the output only says whether a `rua` address exists (`ruaPresent`).

**Does it count nested SPF includes?** No. It counts the top-level DNS lookups in the SPF record; nested includes are not expanded.

### Use it from code (API)

```bash
curl -X POST "https://api.apify.com/v2/acts/mossfetch~dns-email-auth-check/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domains":["example.com","github.com"]}'
```

Or with the JavaScript client: `await new ApifyClient({ token }).actor('mossfetch/dns-email-auth-check').call(input)`, then read `defaultDatasetId`.

### Use in Make, n8n or Zapier

Run this Actor from Make, n8n or Zapier with an Apify account: add the Apify "Run Actor" step and select or enter the Actor `mossfetch/dns-email-auth-check` (Actor ID `yIfe6LwhKIInKPD98`). Pass the input as JSON, then read the dataset in the next step. Nothing else to install.

# Actor input Schema

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

Domains to check, e.g. example.com. URLs and emails are reduced to the domain.

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

Selectors to probe. Defaults to 12 common ones.

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

Domains checked in parallel (max 50).

## `timeoutSecs` (type: `integer`):

How long to wait for each DNS answer before marking it TIMEOUT.

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

Optional resolver IPs. Empty uses the system resolver.

## Actor input object example

```json
{
  "domains": [
    "google.com",
    "github.com",
    "example.com"
  ],
  "dkimSelectors": [
    "default",
    "google",
    "selector1",
    "selector2",
    "k1",
    "k2",
    "mail",
    "s1",
    "s2",
    "dkim",
    "mandrill",
    "smtp"
  ],
  "concurrency": 25,
  "timeoutSecs": 4,
  "dnsServers": []
}
```

# Actor output Schema

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

One row per domain: grade, issues, A/AAAA, NS, MX, SPF, DMARC and DKIM.

## `allFields` (type: `string`):

Every field for every domain, including parsed SPF and DMARC records.

# 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",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mossfetch/dns-email-auth-check").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",
        "example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("mossfetch/dns-email-auth-check").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",
    "example.com"
  ]
}' |
apify call mossfetch/dns-email-auth-check --silent --output-dataset

```

## MCP server setup

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

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/yIfe6LwhKIInKPD98/builds/R20oXobq2orVngONW/openapi.json
