# Domain Health Checker: DNS, SPF, DKIM, DMARC (`clearcheck/domain-health-checker`) Actor

Bulk domain health checker: DNS, SPF, DKIM, DMARC, SSL certificate expiry, security headers and RDAP registration data, with a 0-100 score per domain.

- **URL**: https://apify.com/clearcheck/domain-health-checker.md
- **Developed by:** [ClearCheck Tools](https://apify.com/clearcheck) (community)
- **Categories:** Developer tools, SEO 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 $4.00 / 1,000 domain analyseds

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

## Domain Health Checker: DNS, SPF, DKIM, DMARC

Audit up to **1,000 domains per run** and get one clean JSON record per domain: DNS records, email authentication (SPF, DKIM, DMARC), SSL certificate status, HTTP to HTTPS redirect, security headers, registration data (RDAP) and a **0-100 health score with a prioritized list of alerts**.

No scraping of third-party sites. Everything is read from public DNS, a direct TLS connection to the domain, one HEAD request over HTTP and one over HTTPS to the domain itself, and the public RDAP protocol.

### Use cases

- **Agencies and MSPs**: monitor the domains of all your clients and catch expiring certificates or missing DMARC before the client does.
- **Cold email and deliverability teams**: check SPF, DKIM and DMARC on every sending domain before launching a campaign.
- **Security and compliance**: find domains without HSTS, without HTTPS redirect, or with an untrusted certificate chain.
- **Domain portfolio owners**: track registration expiry dates and registrars across hundreds of names.
- **Sales and M\&A research**: quickly rank a list of prospect domains by technical hygiene.

Schedule the Actor daily or weekly and plug the dataset into Slack, Google Sheets or your monitoring via Apify integrations and webhooks.

### What is checked

| Area | Details |
|---|---|
| DNS | A, AAAA, MX, NS, TXT, CNAME |
| SPF | presence, validity (multiple records, missing `all`, `+all`, 10-lookup limit with include resolution), qualifier |
| DKIM | about 20 common selectors (default, google, selector1/2, k1/k2/k3, s1/s2, mandrill, ...) plus your own selectors |
| DMARC | presence, policy (`none`/`quarantine`/`reject`), subdomain policy, pct |
| SSL | issuer, valid from/to, days before expiry, chain trusted, hostname match, TLS version, SAN list |
| HTTP | HTTP to HTTPS redirect, HSTS (max-age), CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP |
| Registration (RDAP) | creation date, expiry date, registrar, domain age, status flags, DNSSEC |
| Score | 0-100 and A-F grade, with alerts of severity `critical`, `high`, `medium`, `low`, `info` |

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `domains` | array of strings | required | Up to 1,000 domains. URLs, `www.` and trailing dots are normalized; duplicates removed. |
| `checkDkim` | boolean | true | Test common DKIM selectors. |
| `dkimSelectors` | array | \[] | Extra selectors to test. |
| `checkSsl` | boolean | true | Direct TLS connection on port 443. |
| `checkHttp` | boolean | true | Redirect and security headers. |
| `checkRdap` | boolean | true | Registration data via rdap.org. |
| `concurrency` | integer | 10 | Domains analysed in parallel (1-50). |
| `timeoutSecs` | integer | 10 | Timeout per DNS/TLS/HTTP operation. |
| `dnsServers` | array | \[] | Custom resolvers (default: 1.1.1.1, 8.8.8.8, 9.9.9.9). |

```json
{ "domains": ["apify.com", "github.com", "example.org"], "concurrency": 10 }
```

### Output (one item per domain)

```json
{
  "domain": "github.com",
  "status": "ok",
  "score": 99,
  "grade": "A",
  "alerts": [
    { "severity": "info", "code": "SPF_SOFTFAIL", "message": "SPF ends with ~all (softfail)." }
  ],
  "dns": {
    "A": ["20.87.245.0"], "AAAA": [],
    "MX": [{ "priority": 0, "exchange": "github-com.mail.protection.outlook.com" }],
    "NS": ["dns1.p08.nsone.net", "ns-1283.awsdns-32.org"],
    "TXT": ["v=spf1 ip4:192.30.252.0/22 include:spf.protection.outlook.com ... ~all"],
    "CNAME": []
  },
  "email": {
    "spf": { "present": true, "valid": true, "lookups": 10, "all": "~", "issues": [] },
    "dmarc": { "present": true, "policy": "quarantine", "subdomainPolicy": "reject", "pct": 100, "issues": [] },
    "dkim": { "found": [{ "selector": "google", "keyType": "rsa", "hasPublicKey": true }], "selectorsTested": 20 }
  },
  "ssl": {
    "available": true, "issuer": "Sectigo Limited", "validFrom": "2026-10-30T00:00:00.000Z",
    "validTo": "2027-01-27T23:59:59.000Z", "daysUntilExpiry": 69, "chainValid": true,
    "hostnameMatches": true, "protocol": "TLSv1.3"
  },
  "http": {
    "httpStatus": 301, "redirectsToHttps": true, "httpsStatus": 200,
    "finalSecurityHeaders": { "hsts": "max-age=31536000; includeSubdomains; preload", "xFrameOptions": "deny", "xContentTypeOptions": "nosniff" },
    "missingSecurityHeaders": ["permissionsPolicy", "coop"]
  },
  "registration": {
    "available": true, "registrar": "MarkMonitor Inc.", "createdAt": "2007-10-09T18:20:50Z",
    "expiresAt": "2028-10-09T18:20:50Z", "daysUntilExpiry": 690, "ageDays": 6980
  }
}
```

Export as JSON, CSV, Excel or via API. A `SUMMARY` record in the key-value store gives run totals.

#### Statuses

`ok` (analysed), `nxdomain` (domain does not exist, score 0), `error` (DNS completely unreachable), `invalid_input` (not a domain name).

### Pricing

Pay per event, no subscription. You can cap spending with the maximum cost per run.

| Event | Price | When it is charged |
|---|---|---|
| Domain analysed | $0.004 per domain ($4 per 1,000) | Once per valid, unique domain that was analysed |

Not charged: invalid entries, duplicates, domains that do not exist and domains whose DNS lookup fails entirely. The Actor stops cleanly when your maximum cost is reached.

### Limits

- Max 1,000 unique domains per run (extra domains are ignored with a warning).
- DKIM is detected only for common selectors; a custom selector is invisible unless you add it in `dkimSelectors`. "No DKIM found" is informational, not proof of absence.
- SSL is read on port 443 of the exact hostname given; other ports and SNI-less setups are not covered.
- Security headers come from the homepage response of the domain itself (HEAD, falling back to GET without reading the body), without following redirects.
- RDAP coverage depends on the registry: a few ccTLDs publish no RDAP, and rdap.org may rate-limit (the Actor retries and falls back to the official IANA bootstrap). Missing RDAP never fails a domain.
- Registrar names only: no registrant contact or personal data is collected, and email addresses in DMARC records are redacted.
- Scores are a heuristic summary, not a certification.

### FAQ

**Does it contact third-party websites?** No scraping. It queries public DNS resolvers, connects to the domain itself over TLS and HTTP(S), and queries the public RDAP service for registration data.

**Can it check subdomains?** Yes for DNS, SSL and headers (mail.example.com). RDAP is resolved on the registrable domain.

**Why is my score lower for a domain without email?** Missing SPF and DMARC costs less when the domain has no MX records.

**How fast is it?** About 1 to 1.5 domains per second at concurrency 10; 1,000 domains take roughly 12 to 15 minutes.

**Is DKIM always detected?** No. Only about 20 common selectors are tested, plus the ones you add in dkimSelectors. No DKIM found is informational, not proof of absence.

### More Actors by clearcheck

- [Email Validator](https://apify.com/clearcheck/email-validator)
- [Broken Link Checker and Sitemap SEO Auditor](https://apify.com/clearcheck/link-sitemap-audit)
- [PDF, DOCX and HTML to Markdown Converter](https://apify.com/clearcheck/document-to-markdown-converter)
- [Website Contact Finder](https://apify.com/clearcheck/website-contact-finder)
- [Bulk Phone Number Validator](https://apify.com/clearcheck/phone-validator)
- [Bulk Image Optimizer](https://apify.com/clearcheck/image-optimizer)
- [OCR Text Extractor](https://apify.com/clearcheck/ocr-text-extractor)
- [Dataset Merger and Deduplicator](https://apify.com/clearcheck/dataset-merge-dedupe)
- [Excel and CSV to JSON Converter](https://apify.com/clearcheck/spreadsheet-to-json)

# Actor input Schema

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

Domain names to analyse (up to 1,000 per run), e.g. example.com. URLs and www. prefixes are normalized; duplicates are removed.

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

Look for DKIM keys at ~20 common selectors (default, google, selector1, k1, s1...).

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

Additional DKIM selectors to test, if you know your mail provider's selectors.

## `checkSsl` (type: `boolean`):

Open a direct TLS connection on port 443 to read the certificate (issuer, dates, chain validity).

## `checkHttp` (type: `boolean`):

Send one HEAD request over HTTP and one over HTTPS to the domain itself (HTTP to HTTPS redirect, HSTS, CSP, X-Frame-Options...).

## `checkRdap` (type: `boolean`):

Query the public RDAP service (rdap.org) for creation date, expiry date and registrar. No personal data is kept.

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

Number of domains analysed in parallel.

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

Timeout applied to each DNS, TLS and HTTP operation.

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

Optional DNS resolver IPs. Default: Cloudflare 1.1.1.1, Google 8.8.8.8 and Quad9 9.9.9.9 (public resolvers, reliable for large TXT records).

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "github.com"
  ],
  "checkDkim": true,
  "dkimSelectors": [],
  "checkSsl": true,
  "checkHttp": true,
  "checkRdap": true,
  "concurrency": 10,
  "timeoutSecs": 10,
  "dnsServers": []
}
```

# Actor output Schema

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

One item per analysed domain with score, alerts, DNS, email authentication, SSL, headers and RDAP data.

## `summary` (type: `string`):

JSON summary of the run.

# 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",
        "wikipedia.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("clearcheck/domain-health-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",
        "wikipedia.org",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("clearcheck/domain-health-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",
    "wikipedia.org"
  ]
}' |
apify call clearcheck/domain-health-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,clearcheck/domain-health-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/OJDZvsalXghXx9VuL/builds/anEMl12umm22p9YLD/openapi.json
