# DNS Records Lookup - A, AAAA, MX, TXT, NS, SOA, CAA in Bulk (`eliai/dns-records-lookup`) Actor

Bulk DNS records lookup for one domain or up to 200: A, AAAA, MX, TXT, NS, CNAME, SOA, CAA and SRV in one JSON row per domain. 100 domains cost $2 ($0.02/domain). Runs with limited permissions, so AI agents can call and pay for it through Apify's x402 agentic payments (experimental).

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

## Pricing

from $16.00 / 1,000 domain lookups

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

**Send domains, get their A, AAAA, MX, TXT, NS, CNAME and other DNS records in one JSON record each.**

| You give it | You get back | You pay (Free plan) |
|---|---|---|
| One domain or a list of up to 50; optionally which record types | Per domain: resolved yes/no and the records grouped by type | **$0.02 per domain** |

Pay per result only: no subscription, no start fee. Paid Apify plans get Store discounts on the price above.

### Example: try it in one click

The input form is already filled in with this example. Press **Start** and you get the output below.

```json
{
  "domain": "google.com",
  "domains": [
    "github.com",
    "cloudflare.com"
  ],
  "recordTypes": []
}
```

Real output from that exact input (run on 2026-09-24; long arrays shortened to a few entries and long text cut for display):

```json
[
  {
    "domain": "github.com",
    "resolved": true,
    "records": {
      "A": [
        "140.82.113.3"
      ],
      "AAAA": [],
      "MX": [
        {
          "exchange": "github-com.mail.protection.outlook.com",
          "priority": 0
        }
      ],
      "TXT": [
        "facebook-domain-verification=39xu4jzl7roi7x0n93ldkxjiaarx50",
        "google-site-verification=82Le34Flgtd15ojYhHlGF_6g72muSjamlMVThBOJpks"
      ],
      "NS": [
        "ns-1707.awsdns-21.co.uk",
        "ns-421.awsdns-52.com"
      ],
      "CNAME": null,
      "SOA": {
        "nsname": "ns-1707.awsdns-21.co.uk",
        "hostmaster": "awsdns-hostmaster.amazon.com",
        "serial": 1,
        "refresh": 7200,
        "retry": 900,
        "expire": 1209600,
        "minttl": 86400
      },
      "CAA": [
        {
          "critical": 0,
          "issue": "letsencrypt.org"
        },
        {
          "critical": 0,
          "issue": "sectigo.com"
        }
      ],
      "SRV": []
    },
    "reverse": [
      {
        "ip": "140.82.113.3",
        "hosts": [
          "lb-140-82-113-3-iad.github.com"
        ]
      }
    ],
    "resolvedAt": "2026-09-24T21:08:50.195Z"
  }
]
```

Resolve every DNS record type for a domain — A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, SRV — in a single call.

**Live on the Apify Store — run it instantly or call it as an agent tool via Apify MCP.**

### What you get

- All record types resolved per domain in one pass (A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, SRV)
- Best-effort reverse (PTR) lookup for the domain's A records
- Bulk mode: pass an array of domains, capped by `maxDomains`
- Graceful handling of missing records (empty arrays / null, never a crash)
- Optional `recordTypes` filter to resolve only the types you need

### Input

```json
{
  "domains": ["github.com", "cloudflare.com"],
  "recordTypes": ["A", "MX", "TXT"],
  "maxDomains": 50
}
```

Single domain works too:

```json
{ "domain": "google.com" }
```

### Output

One dataset item per domain:

```json
{
  "domain": "github.com",
  "resolved": true,
  "records": {
    "A": ["140.82.112.3"],
    "AAAA": [],
    "MX": [{ "exchange": "aspmx.l.google.com", "priority": 1 }],
    "TXT": ["v=spf1 ip4:192.30.252.0/22 include:_spf.google.com ~all"],
    "NS": ["dns1.p08.nsone.net"],
    "CNAME": null,
    "SOA": { "nsname": "dns1.p08.nsone.net", "hostmaster": "hostmaster.nsone.net" },
    "CAA": [{ "critical": 0, "issue": "digicert.com" }],
    "SRV": []
  },
  "reverse": [{ "ip": "140.82.112.3", "hosts": ["lb-140-82-112-3-iad.github.com"] }],
  "resolvedAt": "2026-06-24T00:00:00.000Z"
}
```

Pricing: pay-per-event — one charge per domain checked.

### Pricing

**$0.02 per domain checked** — billed as the `domain-checked` event, all record types included in the one charge. Bulk runs are capped by `maxDomains`, which is also your budget cap.

### Limits

- `maxDomains`: at most 200 (default 50), at least 1.
- Default run settings: 4096 MB memory, 3600 s timeout. Change them per run under Options if a large input needs more.
- Time: the prefilled example finished in 2 s on 2026-10-31; run time grows with the number of inputs.

### FAQ

**How do I look up all DNS records for a domain at once?** Pass the domain — A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, and SRV all resolve in one pass, in one JSON record, instead of nine separate `dig` commands.

**How do I check a domain's MX records for email setup?** Read `records.MX` — each entry has `exchange` and `priority`. Empty MX with an A record present is worth knowing too: mail may still deliver via implicit MX.

**How do I verify my SPF, DKIM, or verification TXT records propagated?** `records.TXT` returns every TXT value verbatim — SPF strings, site-verification tokens, DMARC (query the `_dmarc` subdomain as its own lookup).

**Can I resolve only the record types I need?** Yes — set `recordTypes` (e.g. `["A","MX","TXT"]`). Leave it empty to resolve everything.

**What happens on a domain with missing records?** Missing types come back as empty arrays or null — never a crash — and a best-effort reverse (PTR) lookup of the A records is included in `reverse`.

### For AI agents

This Actor is built to be called by software, not just by people.

- **Mount it directly as an MCP tool** — no Store search, no ranking, just this one tool:
  `https://mcp.apify.com/?actors=eliai/dns-records-lookup`
- **Or call it over HTTP** and get the results in the same request:
  `POST https://api.apify.com/v2/acts/eliai~dns-records-lookup/run-sync-get-dataset-items`
- **Costs are predictable before you call.** Pricing is pay-per-event (see Pricing above), so an agent can budget a run in advance instead of discovering the bill afterwards.
- **Send only the field you mean.** If you pass the bulk field, it is used on its own; the single-value field is a fallback, never merged into your request. You are charged for the items you sent and nothing else.

### Who uses it

- Sysadmins checking A, MX, TXT and CAA records after moving a domain to a new DNS host
- Security researchers mapping a domain's name servers and mail setup during recon
- Email admins confirming verification TXT records published for a SaaS tool
- Domain portfolio managers exporting every record type for a list of domains
- Developers debugging a CNAME or SRV record from a script instead of a terminal

### Changelog

- 2026-11-01: Page text only: the "Try it" block is now headed Example and a Limits section. Code, output and price are unchanged.
- 2026-09-24: New summary at the top of this page: what you send, what you get, the price, and a real output from the prefilled example.

# Actor input Schema

## `domain` (type: `string`):

A single domain to look up (e.g. google.com). Scheme/path are stripped automatically.

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

Multiple domains to look up in one run. When you set this, it is used on its own and the single-value field above is ignored, so you are only charged for the items you sent.

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

Optional subset of record types to resolve. Leave empty for all (A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, SRV).

## `maxDomains` (type: `integer`):

Cap on how many domains to process per run.

## Actor input object example

```json
{
  "domain": "google.com",
  "domains": [
    "github.com",
    "cloudflare.com"
  ],
  "recordTypes": [],
  "maxDomains": 50
}
```

# Actor output Schema

## `results` (type: `string`):

Every item this run produced. Export as JSON, CSV or Excel from the dataset view.

# 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 = {
    "domain": "google.com",
    "domains": [
        "github.com",
        "cloudflare.com"
    ],
    "recordTypes": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("eliai/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 = {
    "domain": "google.com",
    "domains": [
        "github.com",
        "cloudflare.com",
    ],
    "recordTypes": [],
}

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

```

## MCP server setup

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