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

Look up the DNS records of any list of domains: A, AAAA, CNAME, MX, NS, TXT, CAA and SOA, plus the SPF record and DMARC policy, with has-MX, has-SPF and has-DMARC flags. $2 per 1,000 domains; domains that do not exist are free.

- **URL**: https://apify.com/conserving\_celerytop/dns-lookup.md
- **Developed by:** [Don Mangu](https://apify.com/conserving_celerytop) (community)
- **Categories:** Developer tools, SEO tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 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/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

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

This DNS lookup reads the DNS records of any list of domains in one run: A, AAAA, CNAME, MX, NS, TXT, CAA and SOA, plus each domain's SPF record and DMARC policy. It works as a bulk MX lookup, SPF checker and DMARC checker, with true or false flags for has-MX, has-SPF and has-DMARC on every row.

**Cost:** $0.002 per domain ($2 per 1,000). Domains that do not exist, DNS errors and invalid entries are free. No login or API key.

### How to check MX, SPF and DMARC for a list of domains

1. Enter domains under **Domains**, one per line. Website and email addresses work too.
2. Pick **Record types**, or leave all of them. To get only MX records, pick MX and turn off SPF and DMARC.
3. Keep **SPF and DMARC** on for email checks.
4. Click **Start**, then open the **DNS records** or **Email security** table.

Each record type is asked from public DNS, and mail servers come back sorted by priority with TXT records joined. DMARC report addresses are never returned, only the policy tags and whether reports are requested. The form opens with three domains and costs under a cent. Typical uses are email deliverability checks, IT and security audits (name servers, CAA records, mail providers), lead enrichment by mail provider (Google Workspace or Microsoft 365 from MX records) and monitoring DNS changes.

### How much does the DNS lookup cost?

| Event | Price |
|---|---|
| Domain looked up (`domain-lookup`) | $0.002 ($2 per 1,000) |
| Domain that does not exist, DNS error or invalid entry | Free |

Apify adds only its small standard fee per run start. You can set a spending limit on any run, and the Actor stops cleanly when it is reached.

Example: checking SPF and DMARC for 5,000 client domains costs 5,000 x $0.002 = $10.

### Input

```json
{
  "domains": [
    "apify.com",
    "wikipedia.org",
    "gov.uk"
  ]
}
```

### Output

One row per result:

```json
{
  "domain": "apify.com",
  "a": [
    "104.18.x.x"
  ],
  "mx": [
    {
      "priority": 1,
      "exchange": "aspmx.l.google.com"
    }
  ],
  "ns": [
    "ns1.example-dns.com"
  ],
  "spf": "v=spf1 include:_spf.google.com ~all",
  "dmarcPolicy": {
    "v": "DMARC1",
    "p": "reject",
    "reportsRequested": true
  },
  "hasMx": true,
  "hasSpf": true,
  "hasDmarc": true,
  "status": "ok",
  "charged": true
}
```

`status` is `ok` for domains that were looked up, which are charged. `not_found`, `dns_error` and `invalid_domain` rows are free, with the reason in `error`. If one record type times out, the row is still returned with that type in `failedTypes`.

### Related Actors

- [Domain Authority Checker](https://apify.com/conserving_celerytop/domain-authority-checker): Use it to check domain authority for a bulk list of domains.
- [Company Name to Domain](https://apify.com/conserving_celerytop/company-name-to-domain): Use it to turn a list of company names into official website domains.
- [Tech Stack Detector](https://apify.com/conserving_celerytop/website-tech-stack-detector): Use it to see the CMS, analytics, frameworks, CDN and hosting behind a list of websites.
- [AI Crawler Access Audit](https://apify.com/conserving_celerytop/ai-crawler-access-audit): Use it to check which AI crawlers a website allows or blocks in robots.txt.

### FAQ

**Which DNS servers does it use?** The public resolvers of the Apify platform. Results match what any public resolver returns.

**Can I get only MX records?** Pick MX under **Record types** and turn off SPF and DMARC.

**Why are DMARC report addresses missing?** They can be personal mailboxes, so the Actor returns the policy and whether reports are requested, not the addresses.

**Does it check if a domain is registered?** A domain with no DNS records is returned as not\_found. For registration data use a WHOIS or RDAP lookup.

# Actor input Schema

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

Enter domains, one per line. Website addresses and email addresses work too; the domain is taken from them.

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

Pick the DNS record types to look up. Leave empty for all.

## `includeEmailPolicy` (type: `boolean`):

Add the SPF record and the DMARC policy (from \_dmarc.<domain>), with has-SPF and has-DMARC flags.

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

How many domains to look up in parallel.

## `maxResults` (type: `integer`):

Stop after this many domains.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "wikipedia.org",
    "gov.uk"
  ],
  "recordTypes": [
    "A",
    "AAAA",
    "CNAME",
    "MX",
    "NS",
    "TXT",
    "CAA",
    "SOA"
  ],
  "includeEmailPolicy": true,
  "maxConcurrency": 10,
  "maxResults": 10000
}
```

# Actor output Schema

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

DNS records

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

Email security

## `all` (type: `string`):

Every row with every field.

## `stats` (type: `string`):

Results, free rows, requests and time.

# 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",
        "wikipedia.org",
        "gov.uk"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("conserving_celerytop/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",
        "wikipedia.org",
        "gov.uk",
    ] }

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

```

## MCP server setup

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