# Bulk Email Auth, SPF, DKIM, DMARC & DNSBL Auditor (`regenerative_cornice/email-auth-dns-auditor`) Actor

Bulk passive DNS email authentication auditor for 1 to 1,000+ domains: recursive SPF lookup counting, DMARC alignment & duplicate checks, Google/M365/GoHighLevel/Klaviyo DKIM & subdomain scan, MTA-STS, RDAP age, safe DNSBL check, and 0-100 grade.

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

## Pricing

from $3.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Email Auth, SPF, DKIM, DMARC & DNSBL Security Auditor

Audit **1 to 1,000+ domains** in minutes using **100% passive public DNS queries** — no SMTP connections, no emails sent, and zero registrar credentials required.

Built for **B2B deliverability agencies**, **MSPs**, **cold-email / RevOps teams**, **n8n & Make lead-enrichment builders**, and **AI agents (via Apify MCP)** who need accurate RFC 7208 / RFC 7489 email authentication intelligence, copy-paste SPF fixes, and zero-false-positive blocklist checks at scale.

***

### Why Use This Actor Instead of Basic DNS Lookups?

Most free checkers only inspect top-level TXT strings and throw false positives on modern cloud mail stacks. This Actor implements real deliverability-engineering diagnostics:

- **True Recursive RFC 7208 SPF Lookup Counting**: Recursively expands `include:`, `a`, `mx`, `ptr`, `exists`, and `redirect=` trees with cycle detection and depth guards to detect exact **>10 lookup PermErrors** and dangerous **8–10/10 near-limit fragility**.
- **Automatic Duplicate SPF Consolidation (`spfRecommendedFix`)**: Merges multiple conflicting `v=spf1` records into ONE clean, deduplicated, RFC-7208-valid TXT record while dropping deprecated `ptr` mechanisms and preserving CIDRs.
- **Dynamic SPF Flattening & Macro Guard**: Recognizes managed flattening/macro providers (Valimail, EasyDMARC, AutoSPF, PowerDMARC, Red Sift OnDMARC, Proofpoint, Mimecast, `%{i}`) so you never get false "Missing Google/M365 Include" alerts.
- **RFC 7489 DMARC & Strict `aspf=s` Risk Detection**: Flags missing DMARC, duplicate `_dmarc` records, `p=none` without `rua=`, `sp=none` subdomain spoofing gaps, and **strict `aspf=s`** configurations that silently break Stripe, QuickBooks, Shopify, and Xero invoicing.
- **Google, Microsoft 365, GoHighLevel & Klaviyo DKIM + Subdomain Discovery**: Probes common root DKIM selectors (`google`, `selector1`, `selector2`, `k1`, `k2`, `s1`, `s2`, `kl`, `kl2`, `mailo`, `hs1`, `hs2`, `zendesk1`, `fm1`, etc.), flags duplicate/placeholder `p=...` DKIM entries, and scans dedicated sending subdomains (`email.`, `mail.`, `mg.`, `lc.`, `send.`, `em.`, `replies.`, `notifications.`).
- **Safe DNSBL Blocklist Checks (Zero Open-Resolver False Positives)**: Checks Spamhaus DBL, SURBL Multi, URIBL Multi, and NordSpam DBL with strict return-code guards so open-resolver notices (Spamhaus `127.255.255.252/254/255` and URIBL `127.0.0.1`) are classified as `RESOLVER_BLOCKED` — **never** falsely reported as blacklisted.
- **Transport Hygiene, DNS Host & Optional RDAP Age**: Detects authoritative DNS hosts (Cloudflare, Route 53, GoDaddy, Namecheap, Squarespace, IBM NS1, Azure), Google Workspace/Postmaster verification tokens, `_mta-sts`, `_smtp._tls` TLS-RPT, and optional Verisign/IANA RDAP domain age (`<90-day` warmup risk).

***

### Input JSON

```json
{
  "domains": [
    "cloudflare.com",
    "github.com",
    "https://stripe.com/billing",
    "ops@shopify.com"
  ],
  "checkSubdomains": true,
  "checkBlocklists": true,
  "checkRdapAge": false,
  "maxConcurrency": 10
}
```

| Field | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `domains` | `string[]` | `["cloudflare.com", "github.com"]` | Bare domains, URLs, or email addresses. Automatically normalized and deduplicated. |
| `checkSubdomains` | `boolean` | `true` | Scans GoHighLevel, Mailgun, Klaviyo, SendGrid & HubSpot sending subdomains (`email.`, `mail.`, `mg.`, `lc.`, `send.`, etc.) and subdomain DKIM (`mailo`, `k1`, etc.). |
| `checkBlocklists` | `boolean` | `true` | Queries Spamhaus DBL, SURBL, URIBL, and NordSpam with open-resolver false-positive guards. |
| `checkRdapAge` | `boolean` | `false` | Optional Verisign/IANA RDAP lookup to report domain registration age in days (`rdapAgeDays`). |
| `maxConcurrency` | `integer` | `10` | Parallel domains audited concurrently (`1`–`30`). |

***

### Output JSON Example

Each audited domain produces one flat-friendly, CRM/spreadsheet/webhook-ready dataset record:

```json
{
  "domain": "cloudflare.com",
  "score": 95,
  "grade": "A",
  "riskLabel": "Strong / Enforced",
  "mxProviders": ["Google Workspace"],
  "dnsHost": "Cloudflare",
  "spfStatus": "PASS",
  "spfRecordCount": 1,
  "spfLookups": 6,
  "spfPrimaryRecord": "v=spf1 ip4:199.15.212.0/22 include:_spf.mx.cloudflare.net include:_spf.google.com ~all",
  "spfRecommendedFix": "v=spf1 include:_spf.mx.cloudflare.net include:_spf.google.com ip4:199.15.212.0/22 ~all",
  "dmarcStatus": "PASS",
  "dmarcPolicy": "reject",
  "dmarcRecordCount": 1,
  "dmarcStrictAspfRisk": false,
  "dmarcPrimaryRecord": "v=DMARC1; p=reject; pct=100; rua=mailto:rua@cloudflare.com",
  "dkimActiveSelectors": ["google", "s1", "s2"],
  "sendingSubdomains": [],
  "googleVerificationTokens": ["google-site-verification=..."],
  "mtaStsPresent": true,
  "tlsRptPresent": true,
  "blocklistStatus": "CLEAN_WITH_WEB_VERIFY",
  "blocklistListedCount": 0,
  "rdapAgeDays": null,
  "criticalDefectCount": 0,
  "highDefectCount": 0,
  "findings": [],
  "auditedAtUtc": "2026-11-22T16:45:00Z"
}
```

***

### Pay-Per-Event Pricing Transparency

This Actor uses transparent **Pay-Per-Event (PPE)** billing — you only pay for domains actually audited and pushed to your dataset:

- **Event name**: `domain-audited`
- **Units charged**: `1` event per unique valid domain audited (idempotent per domain via `domain-<clean_domain>`).
- **Zero wasted charges**: Invalid entries and duplicates are filtered before billing, and runs stop gracefully the moment your Apify `maxTotalChargeUsd` budget cap is reached.

***

### Automation Snippets: n8n, Make & AI Agents (Apify MCP)

#### n8n / Make Webhook & Lead-Enrichment Workflow

1. Trigger on new CRM lead / Google Sheet row / Clay table export.
2. Call the **Apify Run Actor** node (or HTTP `POST https://api.apify.com/v2/acts/<ACTOR_ID>/run-sync-get-dataset-items?token=<APIFY_TOKEN>`) with:
   ```json
   {
     "domains": ["{{ $json.company_domain }}"],
     "checkSubdomains": true,
     "checkBlocklists": true,
     "checkRdapAge": false
   }
   ```
3. Route leads automatically: filter where `criticalDefectCount > 0` or `grade` is `D`/`F` to trigger personalized deliverability audit outreach using `spfRecommendedFix` and `findings[0].title`.

#### AI Agents via Apify MCP Server (Claude Desktop, Cursor, Windsurf)

Connect this Actor directly to any MCP-compatible AI assistant to let agents audit prospect or client email security on demand:

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server", "--actors", "<YOUR_USERNAME>/email-auth-dns-auditor"],
      "env": {
        "APIFY_TOKEN": "<YOUR_APIFY_TOKEN>"
      }
    }
  }
}
```

Example agent prompt: *"Audit `acme-agency.com` and `client-shop.com` for SPF lookup PermErrors, DMARC enforcement gaps, and GoHighLevel sending subdomains, then return the exact replacement SPF record for each."*

***

### Privacy & Compliance

All checks performed by this Actor are **100% passive public DNS and optional RDAP queries**. It never sends test emails, never opens SMTP port 25 connections, and never stores private credentials.

# Actor input Schema

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

List of domains to audit passively via public DNS (accepts bare domains like 'cloudflare.com', full URLs like 'https://github.com/org', or email addresses like 'ops@example.com'). Duplicates are automatically merged.

## `checkSubdomains` (type: `boolean`):

Inspect common third-party sending subdomains (email., mail., mg., lc., send., em., replies., notifications.) for GoHighLevel/LeadConnector, Mailgun, Klaviyo, SendGrid, and HubSpot SPF/MX/CNAME and DKIM selectors (mailo, k1, k2, pic, smtp, s1, s2, etc.).

## `checkBlocklists` (type: `boolean`):

Passively query Spamhaus DBL, SURBL Multi, URIBL Multi, and NordSpam DBL with strict false-positive protection against open/public resolver error codes (Spamhaus 127.255.255.252/254/255 and URIBL 127.0.0.1).

## `checkRdapAge` (type: `boolean`):

Optional passive Verisign/IANA RDAP lookup to measure domain registration age in days and flag brand-new (<90-day) domain warmup risks.

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

Maximum number of domains audited concurrently (1–30). Higher values speed up large bulk lists while staying respectful of DNS resolvers.

## Actor input object example

```json
{
  "domains": [
    "cloudflare.com",
    "github.com"
  ],
  "checkSubdomains": true,
  "checkBlocklists": true,
  "checkRdapAge": false,
  "maxConcurrency": 10
}
```

# Actor output Schema

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

Structured overview table of extracted records.

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

All extracted records in the default dataset.

# 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": [
        "cloudflare.com",
        "github.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("regenerative_cornice/email-auth-dns-auditor").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": [
        "cloudflare.com",
        "github.com",
    ] }

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

```

## MCP server setup

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

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/3ecWIsf4Oc18xTxdp/builds/pouccKnaQClUP4J60/openapi.json
