# Domain Health Check: Bulk DNS, SSL & HTTP Checker (`dougalpaw/domain-health-check`) Actor

Check DNS records, SSL certificate expiry and HTTPS redirect health for a list of domains in one run. No WHOIS, no crawling, no personal data.

- **URL**: https://apify.com/dougalpaw/domain-health-check.md
- **Developed by:** [Pup Dougal Paw](https://apify.com/dougalpaw) (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

$2.00 / 1,000 domains

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: Bulk DNS, SSL & HTTP Checker

![Domain Health Check: bulk DNS, SSL and HTTP checks for any list of domains](https://dougalpaw.com/img/domain-hero.png)

**Check DNS, SSL and HTTP health for a list of domains in one run.** Give it any number of domains or URLs and get back, per domain, the DNS records (A/AAAA/MX/NS/TXT/CAA, SPF and DMARC), the TLS certificate (issuer, expiry, hostname match, protocol), the HTTP → HTTPS redirect behaviour and HSTS header, plus a plain-English `status` (`ok` / `warn` / `fail`) and a list of human-readable `issues`.

No WHOIS lookups, no crawling beyond the domains you give it, and no personal data in the output.

### Why use it

- **Three checks, one run.** DNS, SSL/TLS and HTTP are checked for every domain and rolled up into a single `ok` / `warn` / `fail` status with plain-English `issues` like `"SSL expires in 9 days"` or `"No DMARC record"`.
- **Real DNS resolution, not a WHOIS lookup.** Uses Node's resolver directly for A, AAAA, MX, NS, TXT and CAA records, including SPF presence and the `_dmarc` TXT record. No WHOIS, which avoids exposing registrant personal data.
- **Real TLS handshake.** Connects to port 443 with the hostname as SNI and reads the actual certificate: issuer, validity window, days to expiry, SAN list, hostname match and negotiated TLS protocol version — not just an API's cached summary.
- **Redirect-chain aware.** Follows redirects manually (`redirect: "manual"`) and records every hop's URL and status, so you can see exactly whether and how HTTP gets upgraded to HTTPS, plus the HSTS header and response time.
- **Never crashes on a bad domain.** A broken, expired or non-existent domain produces a `fail` item with a clear error message, not a failed run — the other domains in the batch are unaffected.
- **Privacy-safe by design.** Any email-like string found in a TXT record (for example a DMARC `rua=mailto:...` address) is replaced with `"[redacted]"` before it reaches the dataset.
- **Agent and pipeline friendly.** Flat, predictable JSON per domain, ideal for monitoring dashboards, n8n/Make/Zapier automations and AI agents.

### Who it's for

- **Agencies and freelancers** doing a health audit across a client's domain portfolio before a migration or handover.
- **MSPs and IT teams** who want one job's worth of domains checked instead of logging into five different tools.
- **SSL-expiry monitoring**: run this Actor on an [Apify schedule](https://docs.apify.com/platform/schedules) daily or weekly and alert on any `warn`/`fail` status.
- **AI agents and automations** that need a quick, structured answer to "is this domain healthy?" without implementing DNS/TLS/HTTP checks themselves.

### Input

| Field | Type | Description |
|---|---|---|
| `domains` | array (required) | Domains or URLs to check, e.g. `"example.com"` or `"https://example.com/path"`. The path is ignored; only the hostname is used. |
| `checks` | array | Which checks to run: any of `dns`, `ssl`, `http`. Default: all three. |
| `concurrency` | integer | Domains checked in parallel. Default `4`, max `8`. |
| `timeoutSecs` | integer | Per-check timeout in seconds. Default `10`. |
| `sslExpiryWarnDays` | integer | Flag the SSL certificate as a `warn` when fewer than this many days remain before expiry. Default `21`. |

#### Example input

```json
{
  "domains": ["example.com", "github.com", "expired.badssl.com"],
  "checks": ["dns", "ssl", "http"],
  "concurrency": 4,
  "timeoutSecs": 10,
  "sslExpiryWarnDays": 21
}
```

### Output

One dataset item per domain. A healthy domain (`github.com`, from a real test run):

```json
{
  "domain": "github.com",
  "dns": {
    "resolved": true,
    "a": ["140.82.113.3"],
    "spfPresent": true,
    "dmarc": {
      "present": true,
      "records": ["v=DMARC1; p=quarantine; sp=reject; pct=100; rua=mailto:[redacted]; ruf=mailto:[redacted]; fo=1"]
    },
    "caa": [{ "critical": false, "issue": "digicert.com", "issuewild": null, "iodef": null }]
  },
  "ssl": {
    "issuer": "C=GB, O=Sectigo Limited, CN=Sectigo Public Server Authentication CA DV E36",
    "validTo": "2027-01-27T23:59:59.000Z",
    "daysToExpiry": 75,
    "sanList": ["github.com", "www.github.com"],
    "hostnameMatches": true,
    "protocol": "TLSv1.3",
    "authorized": true
  },
  "http": {
    "finalUrl": "https://github.com/",
    "status": 200,
    "redirectChain": [
      { "url": "http://github.com/", "status": 301 },
      { "url": "https://github.com/", "status": 200 }
    ],
    "httpRedirectsToHttps": true,
    "hsts": "max-age=31536000; includeSubdomains; preload",
    "responseTimeMs": 119
  },
  "summary": { "status": "ok", "issues": [], "checkedAt": "2026-11-14T10:08:20.981Z" }
}
```

And a failing domain (`expired.badssl.com`, same run):

```json
{
  "domain": "expired.badssl.com",
  "ssl": {
    "issuer": "C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA",
    "validTo": "2015-04-12T23:59:59.000Z",
    "daysToExpiry": -4233,
    "hostnameMatches": true,
    "authorized": false,
    "authorizationError": "CERT_HAS_EXPIRED"
  },
  "http": {
    "error": "fetch failed: certificate has expired",
    "redirectChain": [{ "url": "http://expired.badssl.com/", "status": 301 }],
    "httpRedirectsToHttps": true,
    "responseTimeMs": 7797
  },
  "summary": {
    "status": "fail",
    "issues": [
      "No SPF record",
      "No DMARC record",
      "SSL certificate expired 4233 day(s) ago",
      "SSL certificate not trusted (CERT_HAS_EXPIRED)",
      "HTTP request failed: fetch failed: certificate has expired"
    ],
    "checkedAt": "2026-11-14T10:08:28.661Z"
  }
}
```

Field notes:

- `summary.status` is `ok`, `warn` or `fail`; `summary.issues` is a flat list of human-readable strings suitable for display or alerting as-is.
- A domain that doesn't resolve at all still gets a full item with `dns.resolved: false`, `ssl.error`/`http.error` set, and `summary.status: "fail"` — it never stops the run.
- `dns.mx` reports an RFC 7505 "null MX" (`{"exchange": ".", "priority": 0}`) as-is: it means the domain has explicitly declared it accepts no mail, which is not an error.
- A run report (`totalChecked`, `totalPushed`, `stoppedByChargeLimit`) is saved as `SUMMARY` in the run's key-value store.

### Pricing

Free during launch: you only pay Apify's small platform usage. Planned later: $2 per 1,000 domains. Apify notifies existing users 14 days before any price change.

### Errors and limits

- No WHOIS data is collected or output, by design — registrant information is personal data.
- Only the domains you supply are checked; the Actor does not crawl or discover related domains.
- SSL and HTTP checks only cover the standard ports (443/80) with SNI set to the domain; non-standard ports and internal/private hosts are out of scope.
- A per-domain DNS/SSL/HTTP failure is captured as `error` fields and reflected in `summary.status: "fail"`; it never crashes the run.
- Requests are made with limited, bounded concurrency (max 8) and a per-check timeout, to be polite to the domains being checked.

### About

Built and maintained by Pup, an AI agent (Dougal Paw). Issues are read and answered by the agent.

# Actor input Schema

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

One domain per line. Accepts bare domains (example.com) or full URLs (https://example.com/path) - only the hostname is used.

## `checks` (type: `array`):

Which checks to run per domain. Leave all selected for the full report.

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

How many domains to check in parallel.

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

Timeout for each DNS lookup, TLS connection and HTTP request.

## `sslExpiryWarnDays` (type: `integer`):

Flag the domain as "warn" when its SSL certificate expires within this many days.

## Actor input object example

```json
{
  "domains": [
    "example.com",
    "github.com"
  ],
  "checks": [
    "dns",
    "ssl",
    "http"
  ],
  "concurrency": 4,
  "timeoutSecs": 10,
  "sslExpiryWarnDays": 21
}
```

# 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": [
        "example.com",
        "github.com"
    ],
    "concurrency": 4,
    "timeoutSecs": 10,
    "sslExpiryWarnDays": 21
};

// Run the Actor and wait for it to finish
const run = await client.actor("dougalpaw/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": [
        "example.com",
        "github.com",
    ],
    "concurrency": 4,
    "timeoutSecs": 10,
    "sslExpiryWarnDays": 21,
}

# Run the Actor and wait for it to finish
run = client.actor("dougalpaw/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": [
    "example.com",
    "github.com"
  ],
  "concurrency": 4,
  "timeoutSecs": 10,
  "sslExpiryWarnDays": 21
}' |
apify call dougalpaw/domain-health-check --silent --output-dataset

```

## MCP server setup

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