# Domain Health Check: DNS, SSL, Security Headers, SPF & DMARC (`devsolal/domain-health-check`) Actor

- **URL**: https://apify.com/devsolal/domain-health-check.md
- **Developed by:** [David-Solal Chalmeau](https://apify.com/devsolal) (community)
- **Categories:** Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Check: DNS, SSL, Security Headers, SPF & DMARC

Check the health of one domain or thousands in a single run. For every domain you get DNS records, email authentication (SPF and DMARC), the TLS certificate and its days remaining, six common HTTP security headers with a score, HTTPS redirect behaviour, and whether `robots.txt`, `security.txt` and `llms.txt` exist. Results are flat JSON with a plain list of issues, ready for dashboards, monitoring, or an AI agent.

### What you get per domain

| Area | Fields |
|---|---|
| DNS | A, AAAA, MX, NS, CAA records |
| Email auth | SPF present and `all` mechanism; DMARC present and policy |
| TLS | issuer, subject, alt names, valid from/to, `daysRemaining`, `expired`, `expiringSoon` (30 days), trusted or not, protocol |
| HTTP | status, final URL, whether `http://` redirects to `https://` |
| Security headers | HSTS (with max-age), CSP, X-Content-Type-Options, X-Frame-Options (CSP `frame-ancestors` counts), Referrer-Policy, Permissions-Policy, score out of 6 |
| Files | `/robots.txt`, `/.well-known/security.txt`, `/llms.txt` exist |
| `issues` | list of `{severity, code, message}` such as `TLS_EXPIRING_SOON`, `DMARC_MISSING`, `NO_HTTPS_REDIRECT` |

### Example input

```json
{ "domains": ["github.com", "example.com"], "maxDomains": 100 }
```

### Example output (trimmed)

```json
{
  "domain": "github.com",
  "dns": { "spf": { "present": true }, "dmarc": { "present": true, "policy": "quarantine" } },
  "tls": { "issuer": "Sectigo Limited", "daysRemaining": 32, "authorized": true },
  "http": { "status": 200, "redirectedToHttps": true },
  "headers": { "score": 5, "maxScore": 6, "missing": ["permissionsPolicy"] },
  "files": { "robotsTxt": true, "securityTxt": true, "llmsTxt": true },
  "issues": [{ "severity": "info", "code": "HEADER_MISSING_PERMISSIONS_POLICY", "message": "Missing security header: permissionsPolicy" }]
}
```

### Pricing

Pay per event: a small start fee per run plus a charge for each domain successfully checked. Invalid inputs, domains with no DNS address, domains that resolve but answer on neither HTTPS nor HTTP, refused (private-address) domains and failed checks are free. If your spending limit is reached, the Actor stops cleanly instead of running unpaid. Current prices are shown on this page.

### Good to know

- Public domain names only. IP addresses, `localhost`, private and internal hostnames are rejected, and redirects to private addresses are refused.
- It performs a handful of ordinary requests per domain (one TLS handshake, DNS lookups, a few `GET`s to the site root and well-known files). It does not crawl the site. Every connection, including each redirect hop, is made to an address validated as public at connect time.
- Header scoring checks presence only. It does not judge whether a CSP is strong.
- `llmsTxt`, `robotsTxt` and `securityTxt` are true only for a 200 non-HTML response.
- DNS lookups for TXT records use DNS-over-HTTPS (Cloudflare) with a fallback to the system resolver.
- A domain behind a bot-protection wall may return a 403 for the home page. The status is reported as-is.

# Actor input Schema

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

Domain names or URLs to check, for example example.com. IP addresses, localhost and private hosts are rejected.

## `maxDomains` (type: `integer`):

Upper bound on domains checked in this run (hard limit 500).

## Actor input object example

```json
{
  "domains": [
    "apify.com"
  ],
  "maxDomains": 100
}
```

# Actor output Schema

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

All checked domains as 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": [
        "apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("devsolal/domain-health-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": ["apify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("devsolal/domain-health-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": [
    "apify.com"
  ]
}' |
apify call devsolal/domain-health-check --silent --output-dataset

```

## MCP server setup

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