# DNS Records Lookup (`properscraper/dns-records-lookup`) Actor

Look up DNS records for a list of domains in bulk: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA, with SPF and DMARC policies explained and the mail and DNS provider named. No API key needed.

- **URL**: https://apify.com/properscraper/dns-records-lookup.md
- **Developed by:** [jake mcclure](https://apify.com/properscraper) (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.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.

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

Look up the DNS records of a list of domains in bulk: A, AAAA, CNAME, MX, NS, TXT, SOA and CAA. For each domain you also get its SPF and DMARC email policies explained, and the company that runs its mail and its DNS.

It asks a public DNS service the same questions any computer asks when it visits a site. No login and no API key are needed.

Use it to:

- see which email provider and DNS host each company in a list uses
- audit SPF and DMARC across all the domains you manage
- check a migration: are the new records live for every domain?
- find domains that no longer exist in a list of leads or links
- monitor records for unexpected changes by running it on a schedule

### Input

| Field | What it does |
|---|---|
| **Domains** | One per line: `example.com`. A web address or an email address also works; its domain is used. |
| **Record types** | Which records to look up. Leave empty for all eight. |
| **Check SPF and DMARC** | Also read and explain the domain's email policies. On by default. |

```json
{
    "domains": ["apify.com", "github.com", "https://www.wikipedia.org/"],
    "recordTypes": ["A", "MX", "NS", "TXT"],
    "includeEmailSecurity": true
}
```

### Output

One record per domain:

```json
{
    "input": "github.com",
    "domain": "github.com",
    "status": "ok",
    "a": ["140.82.121.4"],
    "aaaa": [],
    "cname": null,
    "mx": [
        { "priority": 1, "host": "aspmx.l.google.com" },
        { "priority": 5, "host": "alt1.aspmx.l.google.com" }
    ],
    "ns": ["dns1.p08.nsone.net", "ns-1283.awsdns-32.org"],
    "txt": ["v=spf1 ip4:192.30.252.0/22 include:_netblocks.google.com ~all", "MS=ms44452932"],
    "soa": {
        "primaryNameServer": "dns1.p08.nsone.net",
        "adminEmail": "hostmaster@nsone.net",
        "serial": 1656468023,
        "refreshSeconds": 43200,
        "retrySeconds": 7200,
        "expireSeconds": 1209600,
        "minimumTtlSeconds": 3600
    },
    "caa": [{ "critical": false, "tag": "issue", "value": "letsencrypt.org" }],
    "spf": {
        "record": "v=spf1 ip4:192.30.252.0/22 include:_netblocks.google.com ~all",
        "includes": ["_netblocks.google.com"],
        "all": "~all"
    },
    "dmarc": {
        "record": "v=DMARC1; p=quarantine; sp=reject; pct=100; rua=mailto:dmarc@github.com",
        "policy": "quarantine",
        "subdomainPolicy": "reject",
        "percent": 100,
        "reportTo": ["dmarc@github.com"]
    },
    "mailProvider": "Google",
    "dnsProvider": "NS1",
    "failedTypes": [],
    "scrapedAt": "2026-11-12T19:00:00.000Z"
}
```

- `status` is `ok`, `not_found` (the domain does not exist) or `dns_error` (the domain's own DNS is broken).
- A record type you did not ask for is `null`. One you asked for that has no records is an empty list.
- `spf.all` is how the policy ends: `-all` (reject other senders), `~all` (mark them as suspicious), `?all` (no opinion) or `+all` (allow anyone). `spf` and `dmarc` are `null` when the domain has no such policy.
- `mailProvider` and `dnsProvider` are named when the mail servers or name servers belong to a well-known company, otherwise `null`.
- `failedTypes` lists any record type whose lookup failed while the others worked.

A `SUMMARY` record in the run's key-value store lists how many domains were saved and any that could not be looked up.

### Pricing

Pay per result. You are charged once for each domain saved to the dataset, at the per-result price shown on this page, however many record types you ask for.

A domain is not charged for when the DNS service could not be reached for it; those are listed in the log and the summary so you can run them again. Lines that are not domain names cost nothing. The run stops as soon as it reaches the maximum charge you set for it.

### Limits

- Answers come from a public DNS resolver (Cloudflare's), which caches records for as long as each record allows. A change made minutes ago may not show yet.
- A site behind a content delivery network returns that network's addresses, and they can differ by region.
- The Actor reads records by name. It cannot list a domain's subdomains, and it does not do reverse lookups from an IP address.
- SPF is reported as written. Records referred to by `include:` are listed but not followed.

### Is this allowed?

DNS records are public by design: every domain publishes them so that browsers and mail servers can find it. The Actor asks a public resolver ordinary questions at a modest rate.

# Actor input Schema

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

One per line. A domain name such as example.com. A web address or an email address also works: its domain is used.

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

Which records to look up. Leave empty for all of them. Fewer types means a faster run.

## `includeEmailSecurity` (type: `boolean`):

Also read and explain the domain's SPF and DMARC email policies.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "github.com"
  ],
  "includeEmailSecurity": true
}
```

# Actor output Schema

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

One record per domain looked up.

## `summary` (type: `string`):

Totals for the run and, for each batch of domains, how many results were saved and any error.

# 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"
    ]
};

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

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

```

## MCP server setup

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