# Domain DNS and Email Check: SPF, DMARC, DKIM, MX and SSL (`examsens.ai/domain-dns-check`) Actor

Checks the DNS records, email authentication (SPF, DMARC, DKIM, MX, MTA-STS, BIMI) and HTTPS certificate expiry of domains you name, and lists every problem found.

- **URL**: https://apify.com/examsens.ai/domain-dns-check.md
- **Developed by:** [Ed Rayyis](https://apify.com/examsens.ai) (community)
- **Categories:** Developer tools, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.70 / 1,000 domain processeds

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 DNS and Email Check: SPF, DMARC, DKIM, MX and SSL

Give it a list of domains and it returns, for each one, the DNS records and email authentication setup, the HTTPS certificate, and a plain list of the problems found.

For each domain you get:

- A, AAAA, NS, MX and CAA records
- The SPF record, its `all` policy, and how many DNS lookups it needs (the SPF standard allows 10)
- The DMARC policy, subdomain policy, percentage, alignment modes, and the domains that receive aggregate and failure reports
- DKIM keys found under the selectors you list
- Whether MTA-STS, TLS reporting and BIMI records exist
- The certificate on port 443: issuer, expiry date, days left, host names covered, TLS version

The `issues` list flags, among others: no SPF, two SPF records, SPF ending in `+all` or `?all`, more than 10 SPF lookups, no DMARC, DMARC policy `none`, no DMARC report address, no MX or a null MX, and a certificate that fails verification or expires within your warning window.

### Input

- Domains (required). A full URL also works: the host name is taken from it and a leading `www.` is dropped.
- DKIM selectors (default: default, google, selector1, selector2, k1, k2, s1, s2, dkim, mail). DNS cannot list selectors, so only the ones named are checked.
- Check HTTPS certificate (default on)
- Certificate warning in days (default 21)

### Output

Dataset: one item per domain with `domain`, `ok`, `a`, `aaaa`, `ns`, `mx`, `caa`, `spf`, `dmarc`, `dkim`, `mtaSts`, `tlsRpt`, `bimi`, `certificate`, `issues`, `issueCount`, and `error` when a domain could not be checked. Export as JSON, CSV or Excel, or read it over the API.

### Pricing

Pay per event: one event per domain checked. A domain that fails the check (for example, one with no DNS records) is not charged. The run stops when it reaches the maximum charge you set.

### Scope and conduct

It reads public DNS through the 1.1.1.1, 8.8.8.8 and 9.9.9.9 resolvers and opens one TLS connection to port 443 of each domain. It sends no mail and does not contact mail servers. Mail addresses in DMARC report tags are reduced to their domain, so no mailbox names are stored. There is no WHOIS lookup.

### Support

Questions and problems: the Issues tab on this page. Replies are written by an AI assistant on behalf of the developer and reviewed by the developer.

# Actor input Schema

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

Domain names to check, such as example.com. A full URL also works: the host name is taken from it.

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

DKIM selectors to look up under \_domainkey. DNS cannot list selectors, so only the ones named here are checked. Leave empty to try ten common ones.

## `checkCertificate` (type: `boolean`):

Connect to port 443 of the domain (or www. when the bare domain has no address) and report the certificate issuer and days to expiry.

## `certificateWarningDays` (type: `integer`):

Report an issue when the certificate expires within this many days.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "example.com"
  ],
  "dkimSelectors": [
    "default",
    "google",
    "selector1",
    "selector2",
    "k1",
    "k2",
    "s1",
    "s2",
    "dkim",
    "mail"
  ],
  "checkCertificate": true,
  "certificateWarningDays": 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": [
        "apify.com",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("examsens.ai/domain-dns-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",
        "example.com",
    ] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,examsens.ai/domain-dns-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/PEccMB5ZRcvl6ouLO/builds/HC8JIgporF4zqkQWU/openapi.json
