# Bulk DNS Records Lookup (MX, TXT, SPF, DMARC) (`fleet261114/dns-records-lookup`) Actor

Look up A, AAAA, CNAME, MX, NS, TXT, SOA and CAA records for thousands of domains, with an email-security check per domain: SPF, DMARC policy and common misconfigurations. Uses public DNS resolvers.

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

## Pricing

from $0.35 / 1,000 domain results

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

## Bulk DNS Records Lookup (MX, TXT, SPF, DMARC)

Paste a list of domains (or URLs, or e-mail addresses) and get their **DNS records** in clean JSON: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA by default, SRV and PTR on request. For each domain it also checks **email security**: the SPF record and its `all` mechanism, the DMARC policy, and common mistakes (no SPF, two SPF records, `+all`, no DMARC, `p=none`).

Lookups go to a public resolver (Cloudflare 1.1.1.1 by default; Google or Quad9 on request), run 20 at a time, and finish thousands of domains in minutes.

### Use it for

- **Email deliverability and security audits:** which of your (or your clients') domains lack SPF or DMARC, or still have `p=none`.
- **Domain portfolio checks:** where each domain points (A/AAAA/CNAME), which DNS provider hosts it (NS), who handles its mail (MX), and which certificate authorities may issue for it (CAA).
- **Migrations:** confirm records changed everywhere after moving DNS or mail providers.
- **Lead and market research:** see which email or hosting provider a list of company domains uses (from public MX and NS records).
- **AI agents:** a quick DNS tool through Apify's MCP server.

### Input

| Field | What it does |
|---|---|
| **Domains** (required) | One per line, up to 100,000. URLs and e-mail addresses work too (the domain part is used). |
| Record types | Default A, AAAA, CNAME, MX, NS, TXT, SOA, CAA. Also SRV, PTR. |
| Check email security | Default on: also reads `_dmarc.<domain>` and summarizes SPF/DMARC. |
| DNS resolver | Cloudflare (default), Google, Quad9, or Apify's server default. |
| Return only existing domains | Skip names that do not exist (NXDOMAIN); they are not charged. |
| Parallel lookups | Default 20. |

### Output

One item per domain. A real example from a run on 2026-11-17 with the Actor's default input (default domains: github.com, python.org, gov.uk; long lists cut to three entries):

```json
{
  "domain": "python.org",
  "exists": true,
  "records": {
    "A": [
      "151.101.192.223",
      "151.101.64.223",
      "151.101.128.223",
      "151.101.0.223"
    ],
    "AAAA": [
      "2a04:4e42:600::223",
      "2a04:4e42:200::223",
      "2a04:4e42:400::223",
      "2a04:4e42::223"
    ],
    "CNAME": [],
    "MX": [
      {
        "priority": 50,
        "exchange": "mail.python.org"
      }
    ],
    "NS": [
      "ns-1134.awsdns-13.org",
      "ns-2046.awsdns-63.co.uk",
      "ns-484.awsdns-60.com",
      "ns-981.awsdns-58.net"
    ],
    "TXT": [
      "888acb5757da46ad83b7e341ec544c64",
      "MS=73147F1EC0843C399CF17F586EC6B8EAF8C57961",
      "_globalsign-domain-verification=B57sRQpmte4G4w-gavZbVNmmNsMxGp5kcL19UP2599"
    ],
    "SOA": [
      {
        "primaryNameServer": "ns-2046.awsdns-63.co.uk",
        "serial": 1,
        "refresh": 7200,
        "retry": 900,
        "expire": 1209600,
        "minimumTtl": 86400
      }
    ],
    "CAA": []
  },
  "errors": [],
  "isAlias": false,
  "email": {
    "hasMx": true,
    "nullMx": false,
    "spf": "v=spf1 mx ip4:188.166.95.178/32 ip6:2a03:b0c0:2:d0::71:1 include:stspg-customer.com include:_spf.google.com include:mailgun.org ~all",
    "spfAll": "~all",
    "dmarc": "v=DMARC1; p=none; pct=100; rua=mailto:re+shb8ybr70a3@dmarc.postmarkapp.com; sp=none; aspf=r;",
    "dmarcPolicy": "none",
    "dmarcSubdomainPolicy": "none",
    "dmarcPct": 100,
    "issues": [
      "DMARC policy is p=none (monitoring only, no enforcement)"
    ]
  },
  "lookupMs": 28,
  "resolver": "cloudflare",
  "checkedAt": "2026-11-18T02:03:35.279Z"
}
```

`exists: false` means the name does not exist in DNS (NXDOMAIN). `isAlias: true` means the name is a CNAME; the email check is then skipped, because an alias has no records of its own. `errors` lists record types the resolver could not answer (e.g. `SERVFAIL`), so you can tell "no record" from "lookup failed". `nullMx: true` means the domain explicitly declares it receives no email (RFC 7505).

### Pricing

Pay per result: **$0.0005 per domain returned** ($0.50 per 1,000 domains), with lower prices on Apify's Bronze, Silver and Gold plans, plus Apify's small run-start fee. Invalid lines and duplicates are not charged; with "Return only existing domains", non-existent names are not charged either. You can set a maximum cost per run; the Actor stops cleanly when it is reached.

### Limits and honest notes

- Answers come from the chosen public resolver and may be cached for up to the record's TTL; a change you just made may take a while to show.
- This is DNS only. It does not check whether a domain is available to register, and it does not use WHOIS/RDAP.
- The SPF lookup-count check is an estimate from the record text; it does not expand `include:` chains.
- DKIM is not checked, because DKIM selectors are not discoverable from DNS without knowing them.
- DNS records are public. The SOA record's contact mailbox is not included.

### Use it from the API, a schedule or an AI agent

**API.** Look up domains and get the records in one call (replace `YOUR_APIFY_TOKEN`):

```bash
curl -X POST "https://api.apify.com/v2/acts/fleet261114~dns-records-lookup/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"domains": ["github.com", "python.org"], "recordTypes": ["MX", "TXT"]}'
```

**Schedules and integrations.** Save a task with your domain list and schedule it weekly to catch DNS or email-security changes; send results to Google Sheets, Slack, Make, Zapier or n8n.

**AI agents (MCP).** Add the Actor as a tool in any MCP client (Claude, Cursor and others) through Apify's hosted MCP server:

```
https://mcp.apify.com?tools=fleet261114/dns-records-lookup
```

Set a maximum cost per run in the call options to cap spending.

### FAQ

**Can I check if a domain is available to buy?** Not reliably: a registered domain can have no DNS records. Use a registrar for availability. `exists: false` only tells you the name has no DNS.

**Why do results differ from my computer?** Resolvers cache records; your computer may use your ISP's or company's resolver, which can return different or filtered answers.

**Does it check DKIM?** No, see the limits above.

**What does a typical run cost?** At $0.0005 per domain, 1,000 domains cost about $0.50.

### Questions and problems

Open an issue on the Actor's **Issues** tab with the run link.

# Actor input Schema

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

One domain per line (up to 100,000 per run). URLs and e-mail addresses are accepted too: only the domain part is used. International names are converted to punycode. Duplicates are looked up once.

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

Which DNS record types to look up. Allowed: A, AAAA, CNAME, MX, NS, TXT, SOA, CAA, SRV, PTR.

## `checkEmailSecurity` (type: `boolean`):

Also look up \_dmarc.<domain> and summarize MX, SPF and DMARC: policy, permissive SPF, duplicate records, missing records.

## `resolver` (type: `string`):

Public resolver to ask. Results can differ slightly between resolvers (caching, filtering).

## `onlyExisting` (type: `boolean`):

Skip domains that do not exist in DNS (NXDOMAIN). They are counted in RUN_SUMMARY and not charged.

## `concurrency` (type: `integer`):

Domains looked up at the same time.

## Actor input object example

```json
{
  "domains": [
    "github.com",
    "python.org",
    "https://www.gov.uk/"
  ],
  "recordTypes": [
    "A",
    "AAAA",
    "CNAME",
    "MX",
    "NS",
    "TXT",
    "SOA",
    "CAA"
  ],
  "checkEmailSecurity": true,
  "resolver": "cloudflare",
  "onlyExisting": false,
  "concurrency": 20
}
```

# 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",
        "python.org",
        "https://www.gov.uk/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fleet261114/dns-records-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",
        "python.org",
        "https://www.gov.uk/",
    ] }

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

```

## MCP server setup

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