# Bulk DNS Lookup (A, MX, NS, TXT, CNAME, SOA, CAA Records) (`pagecraft/dns-lookup`) Actor

Look up DNS records for many domains at once: A, AAAA, CNAME, MX, NS, TXT and SPF, SOA and CAA, plus email provider and DNS host. Clean JSON, no login.

- **URL**: https://apify.com/pagecraft/dns-lookup.md
- **Developed by:** [Pagecraft Tools](https://apify.com/pagecraft) (community)
- **Features:** Limited permissions
- **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

## Bulk DNS Lookup: A, MX, NS, TXT, CNAME, SOA and CAA Records

**For** IT teams, MSPs, sales teams and developers who need DNS answers for many domains. **You get** A, AAAA, CNAME, MX, NS, TXT (with SPF), SOA and CAA records per domain, plus the email provider and DNS host.

**Real run (20 Nov 2026, the example input):** apify.com, stripe.com and bbc.co.uk, 3 domains in 2 seconds. **The example input costs 0.6 cents** on Apify's Free plan.

| hostname | A records | MX records | nameservers | TXT records | email provider | DNS host |
| --- | --- | --- | --- | --- | --- | --- |
| apify.com | 4 | 5 | 4 | 14 | Google Workspace | Amazon Route 53 |
| stripe.com | 2 | 5 | 4 | 40 | Google Workspace | Amazon Route 53 |
| bbc.co.uk | 4 | 2 | 8 | 22 | Self-hosted or other | Other |

Look up **DNS records for a whole list of domains or hostnames** in one run: **A, AAAA, CNAME, MX, NS, TXT (with SPF), SOA and CAA**, plus the **email provider** and **DNS host** each domain uses.

### Quick start

1. Press **Try for free**. The form opens with a working example (`apify.com`, `stripe.com` and more).
2. Replace it with your own domains or hostnames.
3. Press **Start**. Results appear as they are found; download them as Excel, CSV or JSON, or use the API.

A result looks like this (some columns):

| hostname | domain | emailProvider | dnsProvider |
| --- | --- | --- | --- |
| stripe.com | stripe.com | Google Workspace | Amazon Route 53 |

### What it does

- Queries public DNS resolvers (Cloudflare 1.1.1.1 and Google 8.8.8.8) for every record type you choose.
- Accepts domains, hostnames (www.acme.com, mail.acme.com), URLs or email addresses, and removes duplicates.
- Pulls out the SPF record from TXT and sorts MX records by priority.
- Names the email provider (Google Workspace, Microsoft 365 and more, from MX), the DNS host (Cloudflare, Route 53 and more, from NS) and services verified in TXT records.
- Reports domains that do not exist instead of failing the run.

### Who it's for

- **IT teams and MSPs** auditing many client domains or preparing a migration.
- **Sales and marketing teams** finding which companies use Google Workspace or Microsoft 365.
- **Security and domain researchers** checking nameservers, CAA and mail setup at scale.
- **Developers and AI agents** that need DNS answers as clean JSON.

### Input

| Field | What to enter |
| --- | --- |
| Domains or hostnames | One per line: `acme.com`, `www.acme.com`, `https://acme.com/page` or `jo@acme.com`. |
| Record types | Any of A, AAAA, CNAME, MX, NS, TXT, SOA, CAA (default: all). |
| Detect email provider and DNS host | On by default. |

```json
{ "domains": ["apify.com", "stripe.com", "bbc.co.uk"], "recordTypes": ["A", "MX", "NS", "TXT"] }
```

### Output

One row per domain or hostname. A record type you did not ask for is `null`; a type with no records is an empty list.

The stripe.com row from that run (TXT strings left out here for length):

```json
{
  "input": "stripe.com",
  "hostname": "stripe.com",
  "domain": "stripe.com",
  "a": [
    "198.137.150.231",
    "198.202.176.231"
  ],
  "aaaa": [],
  "cname": [],
  "mx": [
    {
      "priority": 10,
      "host": "aspmx.l.google.com"
    },
    {
      "priority": 20,
      "host": "alt1.aspmx.l.google.com"
    },
    {
      "priority": 20,
      "host": "alt2.aspmx.l.google.com"
    },
    {
      "priority": 30,
      "host": "aspmx2.googlemail.com"
    },
    {
      "priority": 30,
      "host": "aspmx3.googlemail.com"
    }
  ],
  "ns": [
    "ns-1087.awsdns-07.org",
    "ns-1882.awsdns-43.co.uk",
    "ns-423.awsdns-52.com",
    "ns-705.awsdns-24.net"
  ],
  "txt": [
    "(40 TXT strings, omitted here)"
  ],
  "spf": "v=spf1 ip4:198.2.180.60/32 ip4:13.111.2.227/32 include:spf1.stripe.com include:greenhouse-outbound-mail.stripe.com include:_spf.qualtrics.com ~all",
  "soa": {
    "primaryNameserver": "ns-1882.awsdns-43.co.uk",
    "hostmaster": "awsdns-hostmaster.amazon.com",
    "serial": 1,
    "refresh": 900,
    "retry": 900,
    "expire": 1209600,
    "minTtl": 3600
  },
  "caa": [
    {
      "critical": 0,
      "tag": "iodef",
      "value": "mailto:caa-violations@stripe.com"
    },
    {
      "critical": 0,
      "tag": "issue",
      "value": "amazon.com"
    },
    {
      "critical": 0,
      "tag": "issue",
      "value": "digicert.com"
    },
    {
      "critical": 0,
      "tag": "issue",
      "value": "visa.com"
    }
  ],
  "emailProvider": "Google Workspace",
  "dnsProvider": "Amazon Route 53",
  "verifiedServices": [
    "DocuSign",
    "Meta Business",
    "Google Search Console",
    "OpenAI",
    "Postman",
    "Stripe",
    "Microsoft 365",
    "Apple",
    "Atlassian",
    "Canva"
  ]
}
```

### Pricing

| Event | When it is charged | Price per 1,000 (Free / Bronze / Silver / Gold plan) |
| --- | --- | --- |
| Domain looked up | Each domain or hostname whose DNS records were looked up. | $2 / $1.80 / $1.60 / $1.40 |
| Domain failed | A domain that does not exist or could not be resolved. | $1.50 on every plan |

A domain that does not exist or cannot be resolved is charged at the lower failed rate.

### Notes

- Answers come from public resolvers at the time of the run; recently changed records can take time to update everywhere (TTL).
- CNAME is only present on hostnames that are aliases (often www or subdomains), not on root domains.
- Provider names come from known MX, NS and TXT patterns; unknown setups show as "Other" or "Self-hosted or other".

### Use with AI agents (MCP)

Connect this tool to Claude, Cursor, VS Code or any other MCP client through the [Apify MCP server](https://mcp.apify.com/). To load only this tool, use this server URL:

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

Then ask, for example: "Look up the MX, NS and TXT records for stripe.com and bbc.co.uk and tell me their email provider". The agent gets back each domain's records, SPF, email provider and DNS host. Each call is charged per event at the prices in Pricing above. Agents without an Apify account can also pay per run through [Apify's agentic payments](https://docs.apify.com/agents/payments).

### Workflows with other Pagecraft tools

Pagecraft tools are built to work together. Ideas that use this one:

**Map a company's email and domain setup.** See every DNS record, then check email security and domain age.

1. **This tool**: A, MX, NS, TXT, SOA and CAA records with email provider and DNS host.
2. [DMARC, SPF & DKIM Checker](https://apify.com/pagecraft/email-dns-security-audit): SPF, DMARC and DKIM checks with a score and fixes.
3. [WHOIS Lookup](https://apify.com/pagecraft/domain-whois-lookup): Registrar, creation date and domain age.

### More Pagecraft tools

- [WHOIS Lookup (Bulk Domain Age, Expiry & Registrar)](https://apify.com/pagecraft/domain-whois-lookup): domain age, expiry date and registrar in bulk.
- [Company Data Enrichment from Domain (Contacts, Tech Stack)](https://apify.com/pagecraft/website-intelligence): logo, contacts and tech stack for a list of company websites.
- [Tech Stack Detector (Website Technology Lookup)](https://apify.com/pagecraft/tech-stack-detector): what any website is built with.

# Actor input Schema

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

Domains (acme.com), hostnames (www.acme.com, mail.acme.com), URLs or email addresses (the domain is used). One per line; duplicates are removed.

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

Which DNS record types to look up. Leave empty for all eight.

## `detectProviders` (type: `boolean`):

Adds the email provider (from MX), DNS host (from NS) and verified services (from TXT) for each domain.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "stripe.com",
    "bbc.co.uk"
  ],
  "recordTypes": [
    "A",
    "AAAA",
    "CNAME",
    "MX",
    "NS",
    "TXT",
    "SOA",
    "CAA"
  ],
  "detectProviders": true
}
```

# Actor output Schema

## `results` (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",
        "stripe.com",
        "bbc.co.uk"
    ]
};

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

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

```

## MCP server setup

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