# Bulk DNS Lookup & SPF/DMARC Checker - MX, TXT, NS, A Records (`wood-between-studio/bulk-dns-lookup`) Actor

Look up DNS records for many domains at once: A, AAAA, CNAME, MX, NS, TXT, SOA, CAA. Plus SPF, DMARC, DKIM, MTA-STS and DNSSEC checks with an email security grade. $0.50 per 1,000 domains.

- **URL**: https://apify.com/wood-between-studio/bulk-dns-lookup.md
- **Developed by:** [Wood Between Studio](https://apify.com/wood-between-studio) (community)
- **Categories:** Developer tools, SEO tools, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 domain looked ups

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

## Bulk DNS Lookup & SPF/DMARC Checker: MX, TXT, NS, A, CAA Records for Many Domains

**Look up DNS records for hundreds or thousands of domains in one run** and get one clean row per domain: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA (plus SRV, PTR and HTTPS on request). With email security checks on, every domain also gets its **SPF record parsed and validated, DMARC policy, DKIM keys for common selectors, MTA-STS, BIMI, DNSSEC and an email authentication grade from A to F**.

### Why use it?

- **All the records in one row.** Spreadsheet-ready output instead of running `dig` 8 times per domain.
- **Real email deliverability checks.** SPF: multiple records, more than 10 DNS lookups, `+all`, missing `all`. DMARC: `p=none`, `pct<100`, missing reports. DKIM: finds active keys and flags revoked ones (`p=` empty). Null MX and parked domains are recognised.
- **Reliable resolvers.** Queries go over DNS-over-HTTPS to Cloudflare with Google as fallback, with retries, so results don't depend on a local resolver.
- **DNSSEC** validation flag for every domain.
- **Cheap.** $0.50 per 1,000 domains. Non-existent domains and failed lookups are free.

### Use cases

- Email deliverability audits for clients or your own domains (SPF/DMARC/DKIM before a campaign or after a migration)
- Domain portfolio and IT inventory: where is DNS hosted, which mail provider, which CA is allowed (CAA)
- Lead enrichment for B2B lists: mail provider from MX (Google Workspace, Microsoft 365...)
- Monitoring DNS changes on a schedule (compare runs)

### Input

| Field | Default | Notes |
|---|---|---|
| `domains` | (required) | Domains, hostnames or URLs |
| `recordTypes` | A, AAAA, CNAME, MX, NS, TXT, SOA, CAA | Also SRV, PTR, HTTPS |
| `emailSecurity` | `true` | SPF, DMARC, DKIM, MTA-STS, BIMI, grade |
| `dkimSelectors` | google, selector1, selector2, default, k1, s1, s2, mail, dkim | Add your provider's selector |
| `resolveIpInfo` | `false` | Reverse DNS (PTR) of A records |
| `maxConcurrency` | `10` | |

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

### Output

```json
{
 "domain": "cloudflare.com",
 "status": "success",
 "a": [
  "104.16.132.229",
  "104.16.133.229"
 ],
 "aaaa": [
  "2606:4700::6810:84e5",
  "2606:4700::6810:85e5"
 ],
 "mx": [
  {
   "priority": 5,
   "exchange": "mxa-canary.global.inbound.cf-emailsecurity.net"
  }
 ],
 "ns": [
  "ns3.cloudflare.com",
  "ns4.cloudflare.com",
  "ns5.cloudflare.com",
  "ns6.cloudflare.com",
  "ns7.cloudflare.com"
 ],
 "soa": {
  "mname": "ns3.cloudflare.com",
  "rname": "dns.cloudflare.com",
  "serial": 2419513043,
  "refresh": 10000,
  "retry": 2400,
  "expire": 604800,
  "minimum": 300
 },
 "caa": [
  {
   "flags": 0,
   "tag": "iodef",
   "value": "mailto:tls-abuse@cloudflare.com"
  },
  {
   "flags": 0,
   "tag": "issue",
   "value": "comodoca.com"
  }
 ],
 "dnssec": true,
 "spfRecord": "v=spf1 ip4:199.15.212.0/22 ip4:173.245.48.0/20 include:_spf.google.com include:spf1.mcsv.net include:spf.mandrillapp.com include:mail.zendesk.com include:stspg-customer.com include:_spf.salesforce.com -all",
 "spfValid": true,
 "spfAll": "-all",
 "spfLookups": 6,
 "spfIssues": [],
 "dmarcPolicy": "reject",
 "dmarcIssues": [],
 "dkimFound": [
  "k1",
  "s1"
 ],
 "dkimRevoked": [],
 "mtaSts": true,
 "bimi": "v=BIMI1; l=https://www.cloudflare.com/cloudflare_1171114652.svg; a=https://www.cloudflare.com/cloudflare_1171114652.pem",
 "emailGrade": "A",
 "error": null
}
```

### Pricing

**$0.50 per 1,000 domains** ($0.0005 per domain), all record types and checks included. Platform usage is included. Domains that don't exist (NXDOMAIN) and failed lookups are not charged. Set a maximum charge per run for a hard cap.

### Limits

- DKIM can only be found for the selectors you list (DNS has no way to list all selectors). Add your mail provider's selector for a complete check.
- The grade is a quick guide (SPF 30, DMARC up to 40, DKIM 20, MTA-STS 5, DNSSEC 5 points), not a guarantee of inbox placement.

### Responsible use

DNS records are public. Use this for audits, research and managing domains. Don't use it to target or flood anyone.

### Support

Need another record type, a selector list for your provider or change alerts? Open an issue on the **Issues** tab. We read every one.

### Call it from curl, JavaScript or Python

You can run this Actor in the [Apify Console](https://apify.com/wood-between-studio/bulk-dns-lookup) with no code, or call it as an API from curl, JavaScript or Python. Replace `YOUR_TOKEN` with an [Apify API token](https://console.apify.com/account/integrations).

#### curl

```bash
curl "https://api.apify.com/v2/acts/wood-between-studio~bulk-dns-lookup/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domains": ["github.com", "cloudflare.com", "example.com"]}'
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('wood-between-studio/bulk-dns-lookup').call({
  "domains": [
    "github.com",
    "cloudflare.com",
    "example.com"
  ]
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("wood-between-studio/bulk-dns-lookup").call(run_input={
  "domains": [
    "github.com",
    "cloudflare.com",
    "example.com"
  ]
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

You can also schedule the Actor, cap the spend per run, and send the dataset to Google Sheets, Slack or a webhook from the Console. Store page: [apify.com/wood-between-studio/bulk-dns-lookup](https://apify.com/wood-between-studio/bulk-dns-lookup).

# Actor input Schema

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

Domains, hostnames or URLs (the host is used).

## `recordTypes` (type: `array`):

DNS record types to fetch.

## `emailSecurity` (type: `boolean`):

Parse SPF and DMARC, check MTA-STS and BIMI, and give an email authentication grade A-F.

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

DKIM keys are found by selector name. Common ones are tried by default; add your own.

## `resolveIpInfo` (type: `boolean`):

Look up the PTR hostname of each IPv4 address found.

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

Domains looked up in parallel.

## Actor input object example

```json
{
  "domains": [
    "github.com",
    "wikipedia.org",
    "example.com"
  ],
  "recordTypes": [
    "A",
    "AAAA",
    "CNAME",
    "MX",
    "NS",
    "TXT",
    "SOA",
    "CAA"
  ],
  "emailSecurity": true,
  "dkimSelectors": [
    "google",
    "selector1",
    "selector2",
    "default",
    "k1",
    "s1",
    "s2",
    "mail",
    "dkim"
  ],
  "resolveIpInfo": false,
  "maxConcurrency": 10
}
```

# Actor output Schema

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

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("wood-between-studio/bulk-dns-lookup").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",
        "wikipedia.org",
        "example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("wood-between-studio/bulk-dns-lookup").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",
    "wikipedia.org",
    "example.com"
  ]
}' |
apify call wood-between-studio/bulk-dns-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wood-between-studio/bulk-dns-lookup"
        }
    }
}
```

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/cIgD0XiAVRirrgslg/builds/S27FvP1gcd31JKWpY/openapi.json
