# SPF, DKIM & DMARC Checker – Bulk DNS & MX Records Lookup (`friedl/dns-email-security-checker`) Actor

Bulk DNS records lookup (A, AAAA, MX, NS, TXT, CAA, SOA) plus email security and deliverability checks: SPF, DKIM, DMARC, MTA-STS, an A–F email security grade, mail provider (Google Workspace, Microsoft 365 …) and email tools. Delta mode alerts on DNS changes.

- **URL**: https://apify.com/friedl/dns-email-security-checker.md
- **Developed by:** [Friedrich K](https://apify.com/friedl) (community)
- **Categories:** Developer tools, Other
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## DNS Lookup & Email Security Checker (SPF, DMARC, DKIM, MX)

Check DNS records and email security of thousands of domains in one run. It is fast and cheap, and you need no API key.

**DNS records:** A, AAAA, MX, NS, TXT, CAA and SOA.

**Email security:**

- **SPF:** the record, its validity, the `all` qualifier (`-all`, `~all`, `?all`, `+all`), multiple-record errors and DNS lookup count
- **DMARC:** policy (`none`, `quarantine`, `reject`), subdomain policy, `pct` and reporting domains
- **DKIM:** tests common selectors (Google, Microsoft 365 and others; you can add your own)
- **MTA-STS, TLS-RPT and BIMI:** whether each is present
- **Score and grade:** a score from 0 to 100 and a grade from A to F, for quick prioritisation

**Detection:**

- **Mail provider** from the MX records: Google Workspace, Microsoft 365, Proofpoint, Mimecast, IONOS, Strato, Zoho and more
- **Email services** that SPF allows to send: HubSpot, Salesforce, Mailchimp, SendGrid, Mailgun, Amazon SES, Zendesk, Brevo and more

**Delta mode:** schedule it and receive only domains whose DNS or email security **changed**.

### Use cases

- **Deliverability audits:** check your own domains or your clients' domains for SPF, DKIM and DMARC errors.
- **IT and security teams, MSPs:** review the email security of the domains you manage and prioritise fixes by grade.
- **Market research:** see how common Google Workspace, Microsoft 365, DMARC or MTA-STS are in a list of company domains (aggregated analysis).
- **Monitoring:** run it daily in delta mode to get alerts when MX, NS, SPF or DMARC records change, for example after a provider switch or a misconfiguration.

### Input example

```json
{ "domains": ["apify.com", "https://www.example.com/contact", "info@example.org"], "checkEmailSecurity": true }
```

### Output (one item, shortened)

```json
{
  "domain": "apify.com",
  "resolves": true,
  "a": ["3.162.79.115"],
  "aaaa": ["2600:9000:2759:1a00:9:a03e:6540:93a1"],
  "mx": [{ "exchange": "aspmx.l.google.com", "priority": 1 }],
  "ns": ["ns-1.awsdns-00.com"],
  "txt": ["v=spf1 include:_spf.google.com include:mailgun.org ... -all"],
  "caa": [{ "critical": 0, "tag": "issue", "value": "amazon.com" }],
  "soa": { "primaryNameServer": "ns-1.awsdns-00.com", "serial": 1, "refresh": 7200, "retry": 900, "expire": 1209600, "minTtl": 86400 },
  "mailProvider": "Google Workspace",
  "emailSenders": ["Google", "Mailgun", "Amazon SES", "HubSpot"],
  "spf": { "record": "v=spf1 ...", "valid": true, "multipleRecords": false, "allQualifier": "-all", "topLevelDnsLookups": 6 },
  "dmarc": { "record": "v=DMARC1; p=reject; ...", "policy": "reject", "subdomainPolicy": null, "pct": 100, "reportingDomains": ["apify.com"] },
  "dkimSelectorsFound": ["google"],
  "mtaSts": true,
  "tlsRpt": true,
  "bimi": false,
  "emailSecurityScore": 100,
  "emailSecurityGrade": "A",
  "fetchedAt": "2026-10-08T14:00:00.000Z"
}
```

(Values are illustrative.) The email security fields are omitted for domains that do not resolve. In delta mode, items include `changeType`, and the SOA serial is omitted so that routine zone edits do not trigger changes.

**How the score is calculated:** SPF present (20), SPF with `-all` or `~all` (10), DMARC present (25), DMARC policy `quarantine` or `reject` (20), DKIM selector found (10), MTA-STS (10) and TLS-RPT (5). Grades: A ≥ 85, B ≥ 70, C ≥ 50, D ≥ 30, F < 30. DKIM can only be detected for the tested selectors, so a domain can use DKIM with a selector that is not in the list.

### Pricing

Pay per event: **USD 2.00 per 1,000 domains** (event `result`), with lower prices on higher Apify subscription plans. There is no start fee. Users on the Apify Free plan are limited to 50 domains per run.

Speed: the actor checks 10 domains in parallel, which is about 1,000 domains in 2–4 minutes.

### Privacy and limits

- The actor uses only public DNS. It sends no email, does not verify mailboxes and does not test SMTP.
- Email addresses that appear in DNS records (for example in DMARC `rua` tags or CAA `iodef`) are reduced to their domain (`*@example.com`). The SOA hostmaster mailbox is not returned.
- Results come from the resolver in the actor's data center. TTLs and caching can delay changes by up to the record's TTL.

### Responsibility

DNS records are public technical data. You are responsible for using the results in line with applicable law. In particular, the results do not permit unsolicited marketing emails or calls: in the EU (e.g. § 7 UWG in Germany) such outreach generally requires prior consent. This actor is not affiliated with any of the providers it names; product names are used only to describe detected services.

### Impressum / Legal notice

Anbieter dieses Actors (Angaben gemäß § 5 DDG) / Provider of this actor:

Friedrich Köhler\
Spatzenweg 7\
04720 Döbeln\
Deutschland\
E-Mail: actorcreater_010@web.de

# Actor input Schema

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

Domains to check, one per line. URLs (https://www.example.com/page) and addresses (info@example.com) are reduced to the domain; a leading www. is removed. Duplicates are removed.

## `recordTypes` (type: `array`):

DNS record types to return. MX and the root TXT records are always queried when email security is on.

## `checkEmailSecurity` (type: `boolean`):

Analyse SPF, DMARC, DKIM (common selectors), MTA-STS, TLS-RPT and BIMI, detect the mail provider and the email services allowed to send, and compute a score (0–100) and grade (A–F).

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

DKIM selectors to look up at <selector>.\_domainkey.<domain>. Default: google, selector1, selector2, default, k1, s1, s2, dkim, mail.

## `mode` (type: `string`):

'all' returns every domain. 'delta' returns only domains whose DNS or email security results changed since the last run with the same input – ideal for monitoring your own or your clients' domains.

## `maxResults` (type: `integer`):

Maximum number of domains (= charged events) per run. Users on the Apify Free plan are limited to 50 results per run.

## `deltaStateName` (type: `string`):

Name for the delta state, e.g. "client-domains". Leave empty to derive it from the input. Use different names to run independent monitors.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "github.com"
  ],
  "recordTypes": [
    "A",
    "AAAA",
    "MX",
    "NS",
    "TXT",
    "CAA",
    "SOA"
  ],
  "checkEmailSecurity": true,
  "mode": "all",
  "maxResults": 10000
}
```

# Actor output Schema

## `results` (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": [
        "apify.com",
        "github.com"
    ]
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,friedl/dns-email-security-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/lS2BRpTsdUAvp1zgb/builds/ynGCXOIhROHUhVReo/openapi.json
