# DNS Records Lookup: MX, SPF, DMARC, A, TXT ($0.5/1K) (`tamnt67/dns-records-lookup`) Actor

DNS records lookup: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA records, plus mail provider, SPF record and DMARC policy. Takes a list of domains and queries public DNS over HTTPS. Use it to check MX records and email deliverability setup (SPF, DMARC) for many domains.

- **URL**: https://apify.com/tamnt67/dns-records-lookup.md
- **Developed by:** [Tam Ng.](https://apify.com/tamnt67) (community)
- **Categories:** Developer tools, SEO 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 domains

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 Records Lookup: MX, SPF, DMARC, A, TXT

Look up DNS records for a list of domains in one run, with no login and no API key, for $0.50 per 1,000 domains on the Free plan, down to $0.35 on higher plans.

For each domain the Actor reads A, AAAA, CNAME, MX, NS, TXT, SOA and CAA records and adds a ready-made e-mail check: the mail provider, the SPF record and the DMARC record and policy. It asks public DNS-over-HTTPS resolvers (Cloudflare, with Google Public DNS as fallback) and returns one clean record per domain.

### What you can do with it

- **Qualify leads by e-mail provider.** See which companies run on Google Workspace, Microsoft 365, Zoho Mail and other providers, straight from their MX records.
- **Audit SPF and DMARC before sending e-mail.** Check `hasSpf`, `hasDmarc` and `dmarcPolicy` for your own domains or for a client list.
- **Check which domains are live.** `exists` and `aRecords` show at a glance whether a domain resolves at all.
- **Document DNS during migrations.** Export every record type before and after moving hosting, mail or DNS providers, and compare.
- **Review certificate and nameserver setup.** Read `caaRecords` to see which certificate authorities may issue for a domain, and `nsRecords` for its DNS host.
- **Find site verifications in TXT records.** TXT records often reveal which SaaS tools a company has verified its domain with.

### Output fields

Each domain is one record in the dataset. Example values below come from a real run.

| Field | Example |
|-------|---------|
| `domain` / `exists` | apify.com / true |
| `aRecords` | \["3.170.42.68", "3.170.42.76", ...] |
| `aaaaRecords` | \["2600:9000:2870:1400:9:a03e:6540:93a1", ...] |
| `cnameRecords` | \[] |
| `nsRecords` | \["ns-449.awsdns-56.com", "ns-839.awsdns-40.net", ...] |
| `mxRecords` | \[{"priority": 1, "host": "aspmx.l.google.com"}, ...] |
| `txtRecords` | \["apple-domain-verification=A4eZHTuAHVZqRimj", ...] |
| `soa` | {"primaryNameserver": "ns-839.awsdns-40.net", "adminMailbox": "awsdns-hostmaster.amazon.com", "serial": 1, ...} |
| `caaRecords` | \[{"flags": 0, "tag": "issue", "value": "letsencrypt.org"}, ...] |
| `minTtl` | 60 (lowest TTL among the answers, in seconds) |
| `hasMx` / `mailProvider` | true / Google Workspace (github.com: Microsoft 365) |
| `hasSpf` / `spfRecord` | true / v=spf1 a mx include:\_spf.google.com ... -all |
| `hasDmarc` / `dmarcRecord` / `dmarcPolicy` | true / v=DMARC1; p=reject; ... / reject |
| `dmarcDomain` | apify.com (the domain the DMARC record was found on; for a subdomain without its own record, the registered domain) |
| `scrapedAt` | 2026-11-11T05:18:20.941Z |

If you pick only some record types, only those record fields are included. The mail provider, SPF and DMARC fields are included when **Check mail provider, SPF and DMARC** is on.

Download results as JSON, CSV, Excel or XML, or read them through the Apify API.

### Example output

One real record from a run on `apify.com` (long lists are shortened):

```json
{
  "domain": "apify.com",
  "exists": true,
  "aRecords": ["3.170.42.68", "3.170.42.76", "3.170.42.100", "3.170.42.109"],
  "aaaaRecords": ["2600:9000:2870:1400:9:a03e:6540:93a1", "..."],
  "cnameRecords": [],
  "mxRecords": [
    { "priority": 1, "host": "aspmx.l.google.com" },
    { "priority": 5, "host": "alt1.aspmx.l.google.com" },
    "..."
  ],
  "nsRecords": ["ns-449.awsdns-56.com", "ns-839.awsdns-40.net", "ns-1225.awsdns-25.org", "ns-1928.awsdns-49.co.uk"],
  "txtRecords": ["apple-domain-verification=A4eZHTuAHVZqRimj", "..."],
  "soa": {
    "primaryNameserver": "ns-839.awsdns-40.net",
    "adminMailbox": "awsdns-hostmaster.amazon.com",
    "serial": 1,
    "refresh": 7200,
    "retry": 900,
    "expire": 1209600,
    "minimumTtl": 86400
  },
  "caaRecords": [
    { "flags": 0, "tag": "issue", "value": "amazonaws.com" },
    { "flags": 0, "tag": "issue", "value": "letsencrypt.org" },
    "..."
  ],
  "minTtl": 60,
  "hasMx": true,
  "mailProvider": "Google Workspace",
  "hasSpf": true,
  "spfRecord": "v=spf1 a mx include:_spf.google.com include:mailgun.org include:amazonses.com include:19497222.spf05.hubspotemail.net -all",
  "hasDmarc": true,
  "dmarcRecord": "v=DMARC1; p=reject; sp=reject; pct=100; rua=mailto:dmarc-reports@apify.com; ri=604800",
  "dmarcPolicy": "reject",
  "dmarcDomain": "apify.com",
  "scrapedAt": "2026-11-11T05:18:20.941Z"
}
```

### How to use

1. Paste **Domains**, one per line. Web addresses and e-mail addresses are reduced to the host name; subdomains are kept.
2. Optionally choose **Record types** (A, AAAA, CNAME, MX, NS, TXT, SOA, CAA). Leave empty for all eight. Unknown types are ignored with a warning in the log. Turn **Check mail provider, SPF and DMARC** off if you do not need it.
3. Click **Start**. Records appear in the dataset as each domain is resolved. Export them or read them through the API.

#### Example input

```json
{
  "domains": ["apify.com", "github.com", "https://www.wikipedia.org/wiki/DNS"],
  "recordTypes": ["MX", "TXT"],
  "checkEmailSecurity": true
}
```

### Pricing and cost examples

You pay per domain saved to the dataset ("Domain" event). Platform usage is included in the per-domain price, and the price is the same whether you read one record type or all eight.

| Apify plan | Price per 1,000 domains |
|------------|-------------------------|
| Free (default price) | $0.50 |
| Bronze | $0.45 |
| Silver | $0.40 |
| Gold, Platinum, Diamond | $0.35 |

Cost examples on the Free plan:

- 100 domains ≈ $0.05
- 1,000 domains ≈ $0.50
- 10,000 domains ≈ $5.00 (≈ $3.50 on Gold and higher plans)

The Apify Free plan includes $5 of platform credit every month. If you spend it only on this Actor, that covers about 10,000 domains per month.

A domain is charged when its record is pushed to the dataset. That includes domains that do not exist (`exists: false`), because that answer is a real result. Nothing is charged for entries that are not valid domain names, for duplicates in your list (each domain is looked up once), or for domains where a DNS query still fails after 4 attempts across both resolvers. To set a hard cap, enter a maximum total charge per run in the run options. The Actor stops as soon as that limit is reached.

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

**JavaScript** (`npm install apify-client`):

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('tamnt67/dns-records-lookup').call({
    domains: ['apify.com', 'github.com'],
    recordTypes: ['MX', 'TXT'],
    checkEmailSecurity: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("tamnt67/dns-records-lookup").call(run_input={
    "domains": ["apify.com", "github.com"],
    "recordTypes": ["MX", "TXT"],
    "checkEmailSecurity": True,
})

items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

**cURL** (runs the Actor and returns the records in one call):

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

The sync endpoint waits for the run to finish, so use it for small lists and the client libraries for large ones.

**Schedules:** create an Apify Schedule for this Actor or a saved task to check the same domains daily or weekly, then connect it to Google Sheets or a webhook to notice DNS, SPF or DMARC changes.

**AI agents:** the Apify MCP server at https://mcp.apify.com lets AI assistants such as Claude or Cursor run this Actor and read its results.

### FAQ

#### How much does DNS Records Lookup cost?

DNS Records Lookup costs $0.50 per 1,000 domains on the Free plan and $0.45, $0.40 or $0.35 per 1,000 on higher Apify plans. 100 domains cost about $0.05 on the Free plan. The Free plan's $5 monthly credit covers about 10,000 domains.

#### How many domains can I check in one run?

DNS Records Lookup has no fixed list size. It resolves 8 domains at a time, and all chosen record types for a domain are asked in parallel, so lists of thousands of domains finish quickly.

#### Can I run it on a schedule or through the API?

Yes. DNS Records Lookup works with Apify Schedules for daily or weekly checks, and with the Apify API through the JavaScript and Python clients or a single cURL call. See the API section above for working examples.

#### How fresh is the data?

DNS Records Lookup asks public resolvers live at the time of each run. The resolvers can cache answers for the record's TTL, so a change made a minute ago may not show yet. `minTtl` tells you the shortest cache time among the answers.

#### Does it check whether a mailbox exists?

No. DNS Records Lookup reads public DNS records only. It does not test whether a mailbox exists and does not send any e-mail.

#### Will it hit rate limits?

DNS Records Lookup uses Cloudflare and Google Public DNS over HTTPS. If one resolver returns an error, the Actor waits and retries, switching between the two. A domain that still fails after 4 attempts is logged and not saved, so it is not charged.

### Limitations

- Answers come from public resolvers and can be cached for the record's TTL, so a change made a minute ago may not show yet.
- `mailProvider` is recognised from the MX host names for 18 common providers. It is empty for others; read `mxRecords` in that case.
- DKIM is not checked, because DKIM selectors cannot be listed from outside.
- The Actor does not test whether a mailbox exists and does not send any e-mail.
- SPF is the first TXT record starting with `v=spf1`. Its `include:` parts are not expanded or validated.
- DMARC is read from `_dmarc.` plus the exact name you entered. For a subdomain without its own DMARC record, the record of the registered domain is used (as mail receivers do), `dmarcDomain` shows where it came from, and `dmarcPolicy` is the subdomain policy `sp=` when that record sets one, otherwise `p=`.
- Domains whose DNS servers answer with an error (for example SERVFAIL) are not saved.
- Unknown record types in **Record types** are ignored, with a warning in the log.

### Changelog

- 1.0 update (2026-11-19): an API call that leaves out `domains` no longer gets the example value added; the example is used only when the run has no input source at all.
- 1.0 (2026-11-19): DMARC for a subdomain without its own record now falls back to the registered domain's record (new `dmarcDomain` field); unknown record types now log a warning; README states the exact count of 18 recognised mail providers.

### Integrations

Works with every Apify integration: API, webhooks, Zapier, Make, Google Sheets, Slack, n8n, LangChain and the Apify MCP server.

### Support

Found a problem or missing field? Report it in the Issues tab of this Actor.

# Actor input Schema

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

Domains to look up, one per line, for example apify.com. Full addresses are reduced to the host name.

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

DNS record types to read: A, AAAA, CNAME, MX, NS, TXT, SOA, CAA. Leave empty for all.

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

Add the mail provider and the SPF and DMARC records of each domain.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "github.com",
    "wikipedia.org"
  ],
  "recordTypes": [],
  "checkEmailSecurity": true
}
```

# Actor output Schema

## `domains` (type: `string`):

Dataset with one record per result.

## `domainsCsv` (type: `string`):

The same dataset exported as CSV.

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

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

```

## MCP server setup

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