# Bulk Domain DNS Audit: SPF, DMARC, DKIM & DNSSEC Check (`datacrate/domain-dns-audit`) Actor

Bulk DNS audit for domains: NS, A/AAAA, MX, TXT, SPF, DMARC, DKIM selector probe, CAA, DNSSEC, likely-unregistered flag and an email-security score. DNS only, no WHOIS.

- **URL**: https://apify.com/datacrate/domain-dns-audit.md
- **Developed by:** [Data Crate](https://apify.com/datacrate) (community)
- **Categories:** Developer 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 $0.64 / 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 Domain DNS Audit – SPF, DMARC, DKIM, DNSSEC and unregistered-domain check

Audit a list of domains in seconds, using DNS only. For every domain you get its **nameservers, A/AAAA, MX and TXT records, SPF and DMARC policy, DKIM selectors found, CAA, DNSSEC status, a "likely unregistered" flag and a 0-100 email-security score** with a plain-English issue list.

**First run:** press Start. The prefilled list of 10 sample domains (one of them does not exist) finishes in well under a minute and costs about $0.008 at $0.0008 per domain (less with volume discounts). Starting with empty input audits the same 10 sample domains.

**Who it's for:** deliverability and email-security checks, agencies auditing client or prospect domains, IT and MSP onboarding, brand-protection and domain-portfolio reviews, lead-list cleaning, and finding abandoned domains that no longer resolve.

### What you get per domain

| Field | Meaning |
|---|---|
| `status` | `registered`, `likely-unregistered`, `no-records`, `unknown` (DNS failed, retry) or `invalid` |
| `likelyUnregistered` | `true` when the domain returns NXDOMAIN, confirmed by a second resolver |
| `nameservers`, `a`, `aaaa`, `mx`, `nullMx`, `txt` | Raw DNS records |
| `spfPresent`, `spfPolicy`, `spfRecord` | SPF with policy: `fail` (-all), `softfail` (~all), `neutral`, `pass-all` |
| `dmarcPresent`, `dmarcPolicy`, `dmarcRecord` | DMARC with policy `none`, `quarantine` or `reject` |
| `dkimSelectorsFound` | Which of ~20 common DKIM selectors publish a key |
| `caa` | CAA records (which CAs may issue certificates) |
| `dnssecEnabled`, `dnssecValidated` | DS record at the parent zone, plus the resolver's DNSSEC validation flag |
| `emailSecurityScore`, `emailSecurityGrade` | 0-100 score and A-F grade |
| `issues` | Readable list of problems found |

```json
{
  "domain": "example.org",
  "status": "registered",
  "likelyUnregistered": false,
  "emailSecurityScore": 100,
  "emailSecurityGrade": "A",
  "nameservers": ["ns1.example.net", "ns2.example.net"],
  "spfPolicy": "fail",
  "dmarcPolicy": "reject",
  "dkimSelectorsFound": ["google"],
  "dnssecEnabled": true,
  "issues": []
}
```

### How the email-security score works

SPF up to 30 points (`-all` 30, `~all` 25, `?all` 10, `+all` 0), DMARC up to 40 (`reject` 40, `quarantine` 33, `none` 12), a DKIM key on a common selector 20, and mail servers present 10. Multiple SPF records, an SPF record near the 10-lookup limit and a DMARC `pct` below 100 cost points. Grades: A 90+, B 75+, C 55+, D 35+, F below.

### Input

| Field | What it does |
|---|---|
| `domains` | List of domains. URLs and email addresses are reduced to their domain; internationalised names are converted to punycode |
| `domainsText` | Or paste a blob separated by new lines, spaces, commas or semicolons |
| `checkDkim` | Probe about 20 common DKIM selectors (default on) |
| `dkimSelectors` | Extra selector names to probe |
| `checkDnssec` | DNSSEC check (default on) |

Example: `{ "domains": ["example.com", "yourclient.com"] }`

### Pricing

Pay per event: **$0.0008 per domain audited** (about $0.80 per 1,000), with automatic volume discounts on higher Apify plans (up to 20% off). Duplicate entries are removed before charging, platform usage is included, and the first seconds of compute are covered by Apify.

| Domains | Cost at the base price |
|---|---|
| 10 (the prefilled sample) | about $0.008 |
| 1,000 | about $0.80 |
| 10,000 | about $8.00 |

### Honest limits

- **DKIM:** selectors are chosen by the sender, so a domain can use DKIM on a selector this Actor does not know. "No DKIM found" means none of the common selectors matched; add yours in `dkimSelectors`.
- **"Likely unregistered"** means the name does not resolve (NXDOMAIN). A registered domain without DNS delegation looks the same, and this is **not a registrar availability check**. There is no WHOIS or registry lookup.
- **Temporary DNS failures** are reported as `unknown` and never as unregistered.
- Subdomains are audited as given (`mail.example.com` is its own zone lookup), so SPF/DMARC results for subdomains reflect only that name.

### Data source & legal

- **DNS only.** Lookups use the public DNS protocol through the run's resolver; DNSSEC records and fallbacks use Cloudflare's public DNS-over-HTTPS JSON endpoint.
- **No WHOIS, no registry/RDAP queries, no website crawling, no scraping.** No mail server is contacted.
- Domains are only the input you provide; results are written to your run's dataset.

### Tips

- Filter the dataset on `emailSecurityGrade` in C, D or F to find weak sender domains.
- Filter `likelyUnregistered = true` to spot dead domains in a list.
- Use `?view=overview` on the dataset URL for the compact table or `?view=records` for the raw records.
- Schedule it weekly and add a webhook to catch DNS or DMARC changes.

### FAQ

**Does this check whether a domain is available to register?** No. It flags names that do not resolve (NXDOMAIN) as `likelyUnregistered`, confirmed by a second resolver. It does not query a registrar or WHOIS/RDAP, so treat it as a fast screen, not a purchase check.

**Why does a domain show `unknown`?** DNS failed temporarily (timeout or SERVFAIL). It is never reported as unregistered. Run it again for those rows.

**Can I audit URLs or email addresses?** Yes. They are reduced to their domain, and duplicates are removed.

**What happens with empty input?** The Actor audits the 10 sample domains so the run still succeeds and you can see the output format.

**Does it contact mail servers or crawl websites?** No. DNS queries only.

**How is the score different from other checkers?** It is a simple, documented 0-100 score (see above) so you can filter and sort a large list by `emailSecurityGrade`.

### Integrations

- **Schedule** it weekly or monthly to catch DNS or DMARC changes on your client or portfolio domains.
- **Webhook** on run success to push failing grades (C, D, F) into Slack, email or your ticketing tool.
- **API and clients**: call it from the Apify API, the JavaScript or Python client, Make, Zapier, n8n or Google Sheets.
- **MCP / AI agents**: available through the Apify MCP server, so an agent can ask "audit these domains" and read the dataset.

### Related Actors

- [Email Validator DNS](https://apify.com/datacrate/email-validator-dns) for checking whole email addresses against DNS and mail-server records.
- [US New Business Filings](https://apify.com/datacrate/us-new-business-filings) to pull freshly registered companies, then audit their domains here.

### Changelog

- **1.0** Initial release: NS, A/AAAA, MX, TXT, SPF, DMARC, DKIM probe, CAA, DNSSEC, likely-unregistered flag and email-security score. Empty input falls back to sample domains.

# Actor input Schema

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

Domains to audit (example.com). URLs and email addresses are reduced to their domain. Duplicates are removed. You can also paste a list into 'Domains (text)'.

## `domainsText` (type: `string`):

Optional. Paste domains separated by new lines, spaces, commas or semicolons. Merged with the list above.

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

Look for a DKIM key on about 20 common selectors (google, selector1, selector2, default, k1, s1, ...). Adds about 20 DNS queries per domain. Custom selectors can be added below.

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

Optional. Additional selector names to probe, e.g. your ESP's selector.

## `checkDnssec` (type: `boolean`):

Check for DS and DNSKEY records through Cloudflare DNS-over-HTTPS (Node's built-in resolver cannot read them).

## Actor input object example

```json
{
  "domains": [
    "google.com",
    "github.com",
    "apify.com",
    "cloudflare.com",
    "microsoft.com",
    "stripe.com",
    "wikipedia.org",
    "example.com",
    "gov.uk",
    "this-domain-does-not-exist-xyz123.com"
  ],
  "checkDkim": true,
  "dkimSelectors": [],
  "checkDnssec": true
}
```

# Actor output Schema

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

One DNS audit result per unique domain (default dataset items).

# 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",
        "apify.com",
        "cloudflare.com",
        "microsoft.com",
        "stripe.com",
        "wikipedia.org",
        "example.com",
        "gov.uk",
        "this-domain-does-not-exist-xyz123.com"
    ],
    "checkDkim": true,
    "checkDnssec": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("datacrate/domain-dns-audit").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",
        "apify.com",
        "cloudflare.com",
        "microsoft.com",
        "stripe.com",
        "wikipedia.org",
        "example.com",
        "gov.uk",
        "this-domain-does-not-exist-xyz123.com",
    ],
    "checkDkim": True,
    "checkDnssec": True,
}

# Run the Actor and wait for it to finish
run = client.actor("datacrate/domain-dns-audit").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",
    "apify.com",
    "cloudflare.com",
    "microsoft.com",
    "stripe.com",
    "wikipedia.org",
    "example.com",
    "gov.uk",
    "this-domain-does-not-exist-xyz123.com"
  ],
  "checkDkim": true,
  "checkDnssec": true
}' |
apify call datacrate/domain-dns-audit --silent --output-dataset

```

## MCP server setup

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

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/LAJMCCtdm53jWxTaH/builds/aE3fMah2J2pr0qAGo/openapi.json
