# Domain & Email DNS Audit: RDAP, SPF, DMARC, DKIM, MTA-STS (`cardine-labs/domain-email-dns-audit`) Actor

Domain and email DNS audit in bulk: registrar and expiry from official RDAP, DNS records, SPF with 10-lookup count, DMARC, DKIM, MTA-STS, TLS-RPT, BIMI and TLS certificate expiry. A 0-100 score with prioritized fixes per domain.

- **URL**: https://apify.com/cardine-labs/domain-email-dns-audit.md
- **Developed by:** [Cardine Labs](https://apify.com/cardine-labs) (community)
- **Categories:** Developer tools, SEO tools, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 domains audited

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/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 & Email DNS Audit: RDAP, SPF, DMARC, DKIM, MTA-STS

Audit hundreds of domains in one run. For every domain you get the registration facts from the official registry (registrar, creation and expiry dates, status, name servers, DNSSEC), the DNS records that matter (A, AAAA, MX, NS, TXT, CAA, SOA), a full email authentication check (SPF with DNS lookup counting, DMARC, DKIM, MTA-STS, TLS-RPT, BIMI), the expiry of the website's TLS certificate, and a 0-100 score with a prioritized list of findings. Every finding comes with a concrete fix you can paste into your DNS zone.

### What does Domain & Email DNS Audit do?

You paste a list of domains (or URLs, or email addresses) and the Actor returns one record per domain. Each record answers three questions at once: is the domain safely registered, is the DNS set up correctly, and can other people send email pretending to be this domain?

- **One run, three audits.** Registration (RDAP), DNS and email authentication are checked together, so you do not need to combine a WHOIS tool, a DNS tool and a DMARC checker.
- **SPF lookup counting.** The SPF record is followed recursively through every `include` and `redirect`, and the DNS lookups are counted against the 10-lookup limit of RFC 7208. Records over the limit silently break email delivery; this Actor tells you before your users notice.
- **Actionable fixes, ranked.** Each finding has a severity (critical, high, medium, low, info), a plain-English message and a `fix` field with the exact record or setting to change. The list is sorted so the most urgent item comes first.
- **Expiry alerts.** Domain registrations expiring within your chosen window (30 days by default) and TLS certificates expiring within 14 days are flagged and also listed in the run summary, which makes scheduled monitoring easy.
- **Official sources only.** Registration data comes from the registry RDAP servers listed in the IANA bootstrap file. There is no WHOIS scraping and no registrant contact data is collected.
- **Predictable price.** One event per audited domain. Invalid inputs and failed audits are not charged.

### Who is it for

- **IT and security teams** that look after many company domains, including old brand and campaign domains that nobody remembers to renew.
- **Email deliverability consultants and email marketers** who need to know quickly why mail from a client lands in spam: a missing DMARC record, an SPF record over the lookup limit, a weak DKIM key.
- **Agencies and MSPs** that onboard new clients and want a one-page health check for every domain in the contract.
- **Domain portfolio owners and brand protection teams** who track expiry dates, transfer locks and DNSSEC across registrars.
- **Sales and partnership teams** that qualify prospects by technical maturity (for example "has DMARC at reject" or "uses Google Workspace MX").
- **Developers** who want a JSON API for domain health in their own dashboards, CI checks or alerting.

### How to use it, step by step

1. Open the Actor in the Apify Console and click **Try for free** (or **Start** if you already have it).
2. In **Domains**, paste your domains, one per line. You can paste `example.com`, `https://www.example.com/page` or `info@example.com`; the Actor extracts the domain.
3. Optional: in **DKIM selectors**, add the selectors your mail provider uses (for example `s1` or `google`). DKIM keys cannot be listed from DNS, so a known selector gives the most reliable DKIM result.
4. Optional: change **Registration expiry warning (days)** if you want earlier or later alerts.
5. Click **Start**. Three domains usually finish in under 10 seconds.
6. Open the **Output** tab. The **Audit overview** view shows one row per domain with score, expiry and the top finding; the **Findings and fixes** view shows the full list. Export to CSV, Excel or JSON with one click.
7. To monitor domains, create a **Schedule** (for example weekly) and add a webhook or email notification on run success.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `domains` | array of strings | required | Domains, URLs or email addresses to audit. A leading `www.` is removed. Duplicates are audited once. |
| `dkimSelectors` | array of strings | `[]` | Your own DKIM selectors, checked in addition to the common ones. |
| `checkCommonDkimSelectors` | boolean | `true` | Also try 18 widely used selectors (`default`, `google`, `selector1`, `selector2`, `k1`, `s1`, `mandrill`, `zoho`, ...). |
| `checkRegistration` | boolean | `true` | Registration data from registry RDAP. |
| `checkTlsCertificate` | boolean | `true` | Read the HTTPS certificate on port 443 of the domain or its `www.` host. |
| `expiryWarningDays` | integer | `30` | Flag registrations expiring within this many days. |
| `dnsResolver` | string | `cloudflare` | `cloudflare`, `google`, `quad9` or `system`. |
| `maxDomains` | integer | `1000` | Hard limit per run; also your maximum cost. |
| `maxConcurrency` | integer | `4` | Domains audited in parallel (1-10). |

Example input:

```json
{
  "domains": ["github.com", "apify.com", "wikipedia.org"],
  "dkimSelectors": ["s1"],
  "expiryWarningDays": 45,
  "dnsResolver": "cloudflare"
}
```

### Output

Each dataset item is one domain. This is a real record from a test run on the Apify platform (5 December 2026), shortened only where marked with `...`:

```json
{
  "domain": "apify.com",
  "score": 97,
  "grade": "A",
  "findingsCount": { "critical": 0, "high": 0, "medium": 0, "low": 1, "info": 0 },
  "topFinding": "SPF needs 10 of the 10 allowed DNS lookups.",
  "findings": [
    {
      "severity": "low",
      "area": "spf",
      "code": "spf_lookups_near_limit",
      "message": "SPF needs 10 of the 10 allowed DNS lookups.",
      "fix": "Leave headroom before adding another provider; remove includes you no longer use."
    }
  ],
  "registration": {
    "registered": true,
    "registrar": "Amazon Registrar, Inc.",
    "registrarIanaId": "468",
    "createdAt": "2009-06-02T17:14:10Z",
    "expiresAt": "2035-06-02T17:14:10Z",
    "daysToExpiry": 3101,
    "status": ["client transfer prohibited"],
    "nameservers": ["ns-1225.awsdns-25.org", "ns-1928.awsdns-49.co.uk", "ns-449.awsdns-56.com", "ns-839.awsdns-40.net"],
    "dnssecSigned": true,
    "rdapUrl": "https://rdap.verisign.com/com/v1/domain/apify.com"
  },
  "dns": {
    "mx": [{ "priority": 1, "exchange": "aspmx.l.google.com" }, "..."],
    "caa": ["0 issue \"amazonaws.com\"", "0 issue \"digicert.com\"", "0 issue \"letsencrypt.org\"", "..."],
    "dnssecSigned": true
  },
  "email": {
    "receivesMail": true,
    "spf": {
      "record": "v=spf1 a mx include:_spf.google.com include:mailgun.org include:amazonses.com include:19497222.spf05.hubspotemail.net -all",
      "all": "-",
      "lookups": 10,
      "lookupLimit": 10,
      "lookupLimitExceeded": false,
      "includes": ["_spf.google.com", "mailgun.org", "_spf.mailgun.org", "_spf1.mailgun.org", "_spf2.mailgun.org", "_spf.eu.mailgun.org", "amazonses.com", "19497222.spf05.hubspotemail.net"]
    },
    "dmarc": { "policy": "reject", "subdomainPolicy": "reject", "pct": 100, "rua": ["mailto:dmarc-reports@apify.com"], "adkim": "r", "aspf": "r", "valid": true },
    "dkim": { "found": [{ "selector": "google", "keyType": "rsa", "keyBits": 2048, "revoked": false, "testing": false }] },
    "mtaSts": { "record": "v=STSv1; id=cf154d18ee3b5e8b", "mode": "enforce", "maxAge": 604800 },
    "tlsRpt": { "rua": "mailto:dmarc-reports@apify.com" },
    "bimi": { "logo": "https://apify.com/ext/apify-bimi-logo.svg", "vmc": "https://apify.com/ext/apify-bimi-certificate.pem" }
  },
  "tls": { "host": "apify.com", "daysToExpiry": 196, "validTo": "2027-06-19T20:43:21.000Z", "hostnameMatch": true, "trusted": true, "issuer": "Amazon", "subject": "*.apify.com" },
  "checkedAt": "2026-12-05T14:46:18.418Z"
}
```

A second real record from the same run, reduced to the table columns and the first findings:

```json
{
  "domain": "github.com",
  "score": 82,
  "grade": "B",
  "registrar": "MarkMonitor Inc.",
  "expiresAt": "2028-10-09T18:20:50Z",
  "daysToExpiry": 674,
  "spfLookups": 10,
  "dmarcPolicy": "quarantine",
  "dkimSelectorsFound": ["google", "selector1", "k1", "k2", "s1", "s2"],
  "tlsDaysToExpiry": 53,
  "findings": [
    { "severity": "low", "area": "dns", "code": "no_dnssec", "message": "DNSSEC is not enabled (no DS record at the parent zone).", "fix": "Enable DNSSEC at your DNS provider and publish the DS record at your registrar." },
    { "severity": "low", "area": "dkim", "code": "dkim_1024", "message": "DKIM selector \"selector1\" uses a 1024-bit RSA key.", "fix": "Rotate to a 2048-bit RSA key when your provider supports it." }
  ]
}
```

**Main fields.** `score` starts at 100 and loses 25 points per critical, 15 per high, 8 per medium and 3 per low finding; `grade` is A (90+), B (80+), C (70+), D (60+) or F. `findings[].code` is a stable identifier you can filter on (for example `dmarc_missing`, `spf_too_many_lookups`, `expiry_soon`, `tls_expired`). `registration` holds only registry facts; `dns` holds raw records; `email` holds parsed SPF, DMARC, DKIM, MTA-STS, TLS-RPT and BIMI; `tls` holds the certificate; `sources` lists where each fact came from. The flat columns `registrar`, `expiresAt`, `daysToExpiry`, `spfLookups`, `dmarcPolicy`, `dkimSelectorsFound`, `tlsDaysToExpiry` and `topFinding` power the **Audit overview** table view.

The key-value store also contains a `SUMMARY` record with counts, the grade distribution, the list of domains whose registration or certificate is about to expire, invalid inputs and errors.

### How much does it cost?

The Actor uses pay-per-event pricing: **$0.0015 per audited domain ($1.50 per 1,000 domains)**. Invalid inputs and audits that fail are not charged, and the run stops cleanly if you set a maximum charge.

- 50 client domains for an agency onboarding: **$0.08**
- 1,000 domains in a corporate portfolio, audited weekly (4 runs a month): **$6.00 per month**
- 10,000 domains for a lead qualification list: **$15.00**

Platform usage is small because the Actor only sends DNS queries and a few HTTPS requests: the test run with three domains took under 5 seconds at 256 MB and cost $0.0002 in platform usage. On the Free plan the monthly credit covers thousands of domains.

Honest comparison: `gazidev/bulk-dns-lookup` charges $1 per 1,000 domains for DNS and email checks but has no registration or certificate data; `automation-lab/domain-availability-checker` charges about $2 per 1,000 for registration data only; `santamaria-automations/domain-whois-dns` charges $3 per 1,000; `onescales/dmarc-checker` charges $10 per 1,000 for DMARC only. This Actor costs a little more than the cheapest DNS tool but replaces two or three tools in one run.

### Integrations

Run it from your code with the Apify API. JavaScript:

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('cardine-labs/domain-email-dns-audit').call({ domains: ['example.com', 'example.org'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const d of items) console.log(d.domain, d.score, d.topFinding);
```

Python:

```python
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("cardine-labs/domain-email-dns-audit").call(run_input={"domains": ["example.com"]})
for d in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(d["domain"], d["grade"], d["daysToExpiry"])
```

- **Zapier, Make and n8n**: use the Apify app or node, action "Run Actor", then map `findings` or `topFinding` into Slack, email or a ticket.
- **Google Sheets**: export the **Audit overview** view, or use the Apify integration to append every run to a sheet.
- **Webhooks**: in the Actor's **Integrations** tab, add a webhook on "Run succeeded" and read the `SUMMARY` record to alert only on expiring domains.
- **AI agents (MCP)**: call the Actor from Claude, Cursor or any MCP client through the Apify MCP server or the Cardine Labs MCP servers (for example Website Audit MCP and Web Data Tools MCP).

### Is it legal?

The Actor reads public, technical data that domain owners publish so that the internet can work: DNS records, registry RDAP data and TLS certificates.

- **Sources.** DNS answers come from the public resolver you choose (Cloudflare, Google, Quad9 or the system resolver). Registration data comes from the registry RDAP servers listed by IANA in https://data.iana.org/rdap/dns.json. RDAP is the official successor of WHOIS (RFC 9082/9083) and each response includes the registry's own terms of use. DNSSEC is checked through the DS record at the parent zone (via RDAP or Cloudflare DNS over HTTPS).
- **Limits.** The Actor uses a clear User-Agent, waits at least one second between requests to the same RDAP server, retries politely on 429 and 5xx, and does not scrape WHOIS or any web page.
- **Personal data.** Registrant, administrative and technical contacts are deliberately dropped from RDAP answers. The output contains registrar names, dates, status codes, DNS records and public report addresses written in DMARC or TLS-RPT records (usually role addresses). Under the GDPR the legitimate interest (Article 6(1)(f)) of securing and maintaining domains is the usual legal basis; you remain responsible for how you use the results.
- **No legal judgement.** Findings are technical observations against public standards (RFC 7208, 7489, 8461, 8460, 6376). They do not state that a domain is or is not "compliant" with any law or regulation.

### What this Actor does not do

- It does not check domain availability for purchase or suggest names; a domain without an RDAP record is simply reported as not registered.
- It does not scrape WHOIS, so TLDs without an RDAP service in the IANA bootstrap (for example `.de` at the time of writing) have no registration data; the record says so in an `info` finding.
- It cannot list DKIM keys: DNS does not allow it. It checks your selectors plus 18 common ones.
- It does not send email, test inbox placement or check blocklists.
- It does not validate the BIMI logo or VMC certificate content, only their presence.
- It checks the TLS certificate of the website (apex or `www.`), not of your mail servers.

### Troubleshooting

- **"None of the inputs is a valid domain name".** Check for typos and remove spaces inside names. `localhost` and single-label names are rejected.
- **`rdap_unavailable` finding.** The TLD has no RDAP server in the IANA bootstrap, or the registry did not answer. Check the registry website for that TLD.
- **`dkim_not_found` although you use DKIM.** Your provider uses a selector that is not in the common list. Find it in a sent email header (`DKIM-Signature: ... s=<selector>`) and add it to **DKIM selectors**.
- **`dns_errors` info finding.** A resolver timed out. Run again or switch **DNS resolver**.
- **`tls_unreachable`.** The domain serves no HTTPS on port 443 on the apex or `www.` host; this is normal for mail-only domains.
- **Run stopped early.** You set a maximum charge per run; the `SUMMARY` record has `stoppedByChargeLimit: true`.

### FAQ

**How is this different from gazidev/bulk-dns-lookup?** That Actor is an excellent DNS and email-auth checker at $1 per 1,000. This one adds official registration data (registrar, expiry, transfer lock, DNSSEC) and TLS certificate expiry in the same record, and attaches a fix to every finding, so one run gives a complete domain health report.

**How is this different from automation-lab/domain-availability-checker or santamaria-automations/domain-whois-dns?** Those focus on registration or WHOIS. This Actor uses only RDAP, never collects registrant contacts, and adds the full email authentication audit with SPF lookup counting.

**Why does my SPF show more lookups than I expected?** Every `include`, `a`, `mx`, `ptr`, `exists` and `redirect` costs one lookup, including those inside the records you include. Providers often include further records (Mailgun includes four). The `includes` list shows the full tree.

**Is p=none bad?** It is the right first step: you collect reports without affecting delivery. It is reported as medium because spoofed mail is still delivered. Move to quarantine and then reject after reviewing reports.

**Can I schedule it to alert me before a domain expires?** Yes. Schedule it weekly and read `SUMMARY.registrationExpiringWithin` in a webhook, or filter the dataset on `daysToExpiry`.

**Does it work for subdomains?** Yes. DNS and email checks run on the name you enter; registration data is taken from the parent registered domain, and the record says so.

**Does it need an API key?** No. All sources are free and public.

**Why is the score not 100 for big brands?** Many large domains skip DNSSEC, MTA-STS or BIMI. Each missing control costs only a few points, and the findings explain why it matters.

### Other Cardine Labs Actors

- [Technical SEO Audit & Broken Link Checker](https://apify.com/cardine-labs/seo-site-auditor): crawl a site and find broken links, missing tags and redirect problems.
- [URL Status & Redirect Chain Checker](https://apify.com/cardine-labs/url-status-redirect-checker): bulk HTTP status and hop-by-hop redirect chains for SEO migrations.
- [Tech Stack Detector](https://apify.com/cardine-labs/tech-stack-detector): detect the CMS, analytics and frameworks used by any website.
- [Website Change Monitor](https://apify.com/cardine-labs/website-change-monitor): get alerted when a page changes.
- [Web Data Tools MCP Server](https://apify.com/cardine-labs/web-tools-mcp): give your AI agent web tools through MCP.

# Actor input Schema

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

Domains to audit, one per line. URLs and email addresses are accepted: the domain is extracted and a leading www. is removed. Example: example.com

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

Your own DKIM selectors (the part before .\_domainkey), for example s1 or google. They are checked in addition to the common selectors.

## `checkCommonDkimSelectors` (type: `boolean`):

Try 18 widely used selectors (default, google, selector1, selector2, k1, s1, mandrill, zoho, ...). DKIM keys cannot be listed from DNS, so a domain can have DKIM with a selector that is not checked.

## `checkRegistration` (type: `boolean`):

Look up registrar, creation and expiry dates, registry status and name servers from the official registry RDAP service (IANA bootstrap). Registrant contact data is never collected.

## `checkTlsCertificate` (type: `boolean`):

Read the HTTPS certificate of the domain (or www.) on port 443: expiry, issuer, host name match and trust.

## `expiryWarningDays` (type: `integer`):

Report a high-priority finding when the domain registration expires within this many days.

## `dnsResolver` (type: `string`):

Public resolver used for DNS queries.

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

Hard limit on audited domains per run. This is also your maximum cost.

## `maxConcurrency` (type: `integer`):

Domains audited at the same time (1-10). Lower values are gentler on RDAP servers.

## Actor input object example

```json
{
  "domains": [
    "github.com",
    "apify.com",
    "wikipedia.org"
  ],
  "dkimSelectors": [
    "s1",
    "google"
  ],
  "checkCommonDkimSelectors": true,
  "checkRegistration": true,
  "checkTlsCertificate": true,
  "expiryWarningDays": 30,
  "dnsResolver": "cloudflare",
  "maxDomains": 1000,
  "maxConcurrency": 4
}
```

# Actor output Schema

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

One record per domain with score, findings, registration, DNS, email authentication and TLS data.

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

Counts, grades, domains expiring soon, invalid inputs and errors.

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

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cardine-labs/domain-email-dns-audit"
        }
    }
}
```

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/EbiSoiMFfSGbgD9Cr/builds/C9y4tWgJxGvcfcXgq/openapi.json
