# DNS Lookup: Bulk DNS Records, MX, SPF and DMARC Checker (`publicrecords/dns-lookup`) Actor

Bulk DNS lookup and MX lookup for a list of domains: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA, with SPF and DMARC checker results, email provider and DNSSEC status. One row per domain.

- **URL**: https://apify.com/publicrecords/dns-lookup.md
- **Developed by:** [Public Records](https://apify.com/publicrecords) (community)
- **Categories:** Developer tools, Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.56 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## DNS Lookup: Bulk DNS Records, MX, SPF and DMARC Checker

Paste a list of domains and get one clean row per domain with its DNS records: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA. Each row also checks the SPF and DMARC records, names the email provider from the MX hosts and says whether the answer was DNSSEC-validated.

### Bulk DNS lookup for any list of domains

- **All common record types** in one row: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA, with the TTL of each type.
- **Bulk input.** Thousands of domains per run. Website URLs and email addresses work too: the Actor takes the host name or the part after @. International names are converted to their `xn--` form.
- **Fast.** 200 domains took 10 seconds in our test, and a list of 10,000 domains took 25 minutes.
- **Says when a domain does not exist** (`exists: false`, `dnsStatus: NXDOMAIN`), so you can clean a list of dead domains.
- **Two resolvers.** Lookups go to Cloudflare's 1.1.1.1 over HTTPS, with Google Public DNS as a fallback if Cloudflare errors, returns SERVFAIL or does not answer within 3.5 seconds.

### MX records, SPF and DMARC checker

- **MX records** sorted by priority, plus `acceptsEmail` and the `emailProvider` (Google Workspace, Microsoft 365, Zoho, Proton, Mimecast, Proofpoint and others).
- **SPF:** the record, its `include:` domains, the `all` rule (`-all`, `~all`), the number of top-level DNS-lookup terms, and a `problem` field for common mistakes (two SPF records, no `all` term, more than 10 lookup terms at the top level).
- **DMARC:** the record at `_dmarc.<domain>`, its policy (`none`, `quarantine`, `reject`), subdomain policy, `pct` and report addresses.

### Who it is for

- Email deliverability and IT teams auditing SPF, DMARC and MX across many domains.
- Sales and data teams checking which domains in a lead list exist and accept email, and who hosts their email.
- Developers and SEO teams monitoring DNS changes, name servers and certificate authority (CAA) rules.

### Input

| Field | What it does | Default |
|---|---|---|
| `domains` | Domains, URLs or email addresses, one per line | 3 sample domains |
| `recordTypes` | Record types to return | all eight |
| `emailChecks` | SPF, DMARC and email provider | `true` |

```json
{
  "domains": ["apify.com", "https://www.shopify.com/pricing", "jane.doe@stripe.com"],
  "recordTypes": ["A", "AAAA", "CNAME", "MX", "NS", "TXT", "SOA", "CAA"],
  "emailChecks": true
}
```

### Output

This is a real row from a run on 25 November 2026. To keep it short, `aaaa` shows two of eight addresses, `txt` shows three of 14 records, and `caa` shows two of five.

```json
{
  "input": "apify.com",
  "domain": "apify.com",
  "exists": true,
  "dnsStatus": "NOERROR",
  "dnssecValidated": true,
  "a": ["3.170.42.68", "3.170.42.76", "3.170.42.100", "3.170.42.109"],
  "aaaa": ["2600:9000:2870:c00:9:a03e:6540:93a1", "2600:9000:2870:2000:9:a03e:6540:93a1"],
  "cname": null,
  "mx": [
    { "priority": 1, "host": "aspmx.l.google.com" },
    { "priority": 5, "host": "alt1.aspmx.l.google.com" },
    { "priority": 5, "host": "alt2.aspmx.l.google.com" },
    { "priority": 10, "host": "aspmx2.googlemail.com" },
    { "priority": 10, "host": "aspmx3.googlemail.com" }
  ],
  "mxHosts": ["aspmx.l.google.com", "alt1.aspmx.l.google.com", "alt2.aspmx.l.google.com", "aspmx2.googlemail.com", "aspmx3.googlemail.com"],
  "ns": ["ns-1225.awsdns-25.org", "ns-1928.awsdns-49.co.uk", "ns-449.awsdns-56.com", "ns-839.awsdns-40.net"],
  "txt": [
    "apple-domain-verification=A4eZHTuAHVZqRimj",
    "google-site-verification=R_4agUZyHorQrO5QGFa6ZB_o-uDxq82NY-EteDUpPvo",
    "v=spf1 a mx include:_spf.google.com include:mailgun.org include:amazonses.com include:19497222.spf05.hubspotemail.net -all"
  ],
  "soa": { "primaryNs": "ns-839.awsdns-40.net", "serial": 1, "refresh": 7200, "retry": 900, "expire": 1209600, "minimumTtl": 86400 },
  "caa": [
    { "flags": 0, "tag": "issue", "value": "amazonaws.com" },
    { "flags": 0, "tag": "issue", "value": "letsencrypt.org" }
  ],
  "acceptsEmail": true,
  "emailProvider": ["Google Workspace"],
  "spf": {
    "present": true,
    "record": "v=spf1 a mx include:_spf.google.com include:mailgun.org include:amazonses.com include:19497222.spf05.hubspotemail.net -all",
    "valid": true,
    "problem": null,
    "includes": ["_spf.google.com", "mailgun.org", "amazonses.com", "19497222.spf05.hubspotemail.net"],
    "all": "fail (-all)",
    "dnsLookupMechanisms": 6
  },
  "dmarc": {
    "present": true,
    "record": "v=DMARC1; p=reject; sp=reject; pct=100; rua=mailto:dmarc-reports@apify.com; ri=604800",
    "policy": "reject",
    "subdomainPolicy": "reject",
    "pct": 100,
    "rua": ["dmarc-reports@apify.com"],
    "ruf": []
  },
  "ttl": { "A": 60, "AAAA": 60, "MX": 86400, "NS": 172800, "TXT": 300, "SOA": 900, "CAA": 300 },
  "incomplete": [],
  "resolver": "cloudflare",
  "checkedAt": "2026-11-25T22:04:54.545Z"
}
```

The dataset has three views: **Overview** (one line per domain), **Email security** (MX, SPF and DMARC) and **All records**. Export as JSON, CSV, Excel or HTML, or read the rows with the Apify API.

### Pricing

Each run pays one start fee, then only for domains that return a row.

| Event | Price |
|---|---|
| Actor start (once per run at the default 256 MB) | $0.001 |
| Domain looked up (one row) | $0.0008 |

Examples: 100 domains cost $0.081, and 10,000 domains cost $8.001. A domain that does not exist still gets a row (it says `exists: false`) and is charged like any other row. Entries that are not domain names, and domains whose DNS servers fail for both resolvers, get no row and are not charged; the start fee is still charged once per run.

### Limits

- Answers come from public recursive resolvers, so they can be cached for up to the record's TTL. The Actor does not query each domain's own name servers directly.
- If a name is a CNAME alias (for example `www.github.com`), its other records come from the alias target, the same way any resolver returns them.
- The SPF check reads the top-level record only; it does not follow `include:` domains to count nested lookups.
- `emailProvider` is named from MX host names. Domains that use a mail gateway (for example Mimecast) show the gateway, not the mailbox host behind it.
- Domains whose DNS is broken (SERVFAIL from both resolvers) are skipped with the reason in the run summary. In a test of 200 popular domains, 199 returned a row and one was skipped for SERVFAIL.
- Long lists run at about 7 domains per second once the first few thousand are done, because the public resolvers slow down sustained traffic. In our test, 10,000 popular domains finished in 1,491 seconds (25 minutes), inside the default 60-minute run timeout: 9,989 returned a row, 10 were skipped for SERVFAIL and 1 was not a domain name. For much longer lists, raise the run timeout or split the list.
- If a run gets close to its time limit, it stops taking new domains about a minute before the end, finishes as SUCCEEDED and lists the rest in the run summary as not looked up. Those are not charged.
- PTR (reverse DNS), SRV and other rarer record types are not included. No WHOIS or IP registry data.

### Run summary and errors

Each run saves a `RUN_SUMMARY` record with the number of inputs, rows, domains that do not exist, charged rows, and every skipped entry with its reason. If none of your entries is a domain name, or every lookup fails, the run still ends as SUCCEEDED with zero rows and the reason in the status message. If one record type fails for a domain while the others answer, the row lists it in `incomplete`.

### FAQ

**Can I check only MX records?** Yes. Set `recordTypes` to `["MX"]`. With `emailChecks` on, the SPF and DMARC fields are still filled.

**Does it work for subdomains?** Yes. Enter the full name, for example `mail.example.com`. DMARC is read at `_dmarc.<the name you entered>`.

**What does `dnssecValidated` mean?** The resolver validated the answer with DNSSEC. `false` usually means the domain is not signed.

**Can it check single email addresses?** Use [Email Verifier](https://apify.com/publicrecords/email-verifier), which adds syntax, disposable-domain and role-account checks per address. To see what a site is built with, use [Tech Stack Detector](https://apify.com/publicrecords/tech-stack-detector).

**What if I send a field name this Actor does not use?** If none of the fields you send is one listed under Input, the run ends as SUCCEEDED with 0 rows and the status message names the unknown field; only the start fee is charged. An empty input runs the example input shown under Input. Common alternative names are read as the documented field, for example `email` as `domains` and `recordType` as `recordTypes`.

**Can I call it from code or an AI agent?** Yes. Call it through the Apify API with your Apify token, or add it to an agent through Apify's MCP server (mcp.apify.com), and read the dataset rows.

### Source and licence

DNS answers come from Cloudflare's 1.1.1.1 resolver over DNS-over-HTTPS, with Google Public DNS as the fallback. DNS records are public data published by each domain's owner. The Actor runs on Node.js with the Apify SDK (Apache-2.0).

# Actor input Schema

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

Domain names, one per line (for example `apify.com`). Website URLs and email addresses also work: the Actor takes the host name or the part after @. Duplicates are skipped.

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

DNS record types to return. Leave all selected for a full DNS report.

## `emailChecks` (type: `boolean`):

Parse the SPF record, read the DMARC record at \_dmarc.<domain>, and name the email provider from the MX hosts (Google Workspace, Microsoft 365 and others). Same price.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "github.com",
    "wikipedia.org"
  ],
  "recordTypes": [
    "A",
    "AAAA",
    "CNAME",
    "MX",
    "NS",
    "TXT",
    "SOA",
    "CAA"
  ],
  "emailChecks": true
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `email` (type: `string`):

No description

## `allRecords` (type: `string`):

No description

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

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

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

```

## MCP server setup

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