# DNS Records Scraper – A, AAAA, MX, TXT, NS, CNAME (`ninhothedev/dns-records-scraper`) Actor

$1/1K 🔥 Fast DNS records scraper! A, AAAA, MX, TXT, NS, CNAME & more via DNS-over-HTTPS. JSON, CSV, Excel or API in seconds. Paste domains & resolve thousands of records for recon, security & migration ⚡

- **URL**: https://apify.com/ninhothedev/dns-records-scraper.md
- **Developed by:** [ninhothedev](https://apify.com/ninhothedev) (community)
- **Categories:** Developer tools, Automation, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## DNS Records Scraper – A, AAAA, MX, TXT, NS, CNAME

**Bulk-resolve DNS records for any list of domains: A, AAAA, MX, TXT, NS, CNAME, SOA and CAA — via DNS-over-HTTPS (Google + Cloudflare fallback). As JSON, CSV or Excel. Free, no key, no proxy.**

### 💵 Pricing

**Pay per result — about $1 per 1,000 domains.** No subscription, no proxy needed. You only pay for the domains you resolve, and new Apify accounts include free monthly credits so you can test it for **$0**.

### 🔎 What can it extract?

Per domain, one clean JSON item with:

- **A** and **AAAA** (IPv4 / IPv6 addresses)
- **MX** mail servers (kept as `priority host`)
- **TXT** records (SPF, DKIM, verification tokens…)
- **NS** nameservers
- **CNAME** aliases
- **SOA** start-of-authority
- **CAA** certificate-authority authorization
- `resolved` flag + `scraped_at` timestamp

### 🚀 How do I use it?

1. Click **Try for free**.
2. Paste your domains and pick record types (see example below).
3. Click **Start** and download results as JSON, CSV or Excel — or pull them via the API / schedule them.

### ⚙️ Input example

```json
{
  "mode": "domains",
  "domains": ["google.com", "github.com"],
  "recordTypes": ["A", "AAAA", "MX", "TXT", "NS", "CNAME"],
  "maxItems": 100
}
```

### 📦 Output example

```json
{
  "domain": "google.com",
  "a": ["142.250.72.14"],
  "mx": ["10 smtp.google.com."],
  "ns": ["ns1.google.com", "ns2.google.com", "ns3.google.com", "ns4.google.com"],
  "txt": ["v=spf1 include:_spf.google.com ~all"],
  "resolved": true
}
```

### 🎯 Use cases

- **Recon** — map a target's infrastructure across many domains fast.
- **Security audits** — check SPF/DKIM/DMARC (TXT), CAA and mail routing.
- **Migrations** — snapshot every record before and after a DNS cutover.
- **Monitoring** — schedule runs to catch nameserver or MX changes.

### 💰 How much will it cost?

You pay only the per-result price (no proxy cost):
100 domains → ~$0.10 · 1,000 → ~$1 · 10,000 → ~$10

### 🆚 Why this one

| Feature | This actor | Others |
|---|---|---|
| 8 record types (incl. SOA, CAA) | ✅ | A/MX only |
| Bulk list, one item per domain | ✅ | one at a time |
| DoH with Cloudflare fallback | ✅ | single resolver |
| No key / no proxy | ✅ | sometimes |

### 🔗 Related actors

- [IP Geolocation Scraper](https://apify.com/ninhothedev/ip-geolocation-scraper) — geolocate the IPs you resolve
- [Geocoding Scraper](https://apify.com/ninhothedev/geocoding-scraper) — addresses ↔ coordinates
- [Website Tech Stack Detector](https://apify.com/ninhothedev/website-tech-stack-detector) — technologies behind a domain
- [RDAP Domain Scraper](https://apify.com/ninhothedev/rdap-domain-scraper) — registration & ownership data

### ❓ FAQ

**Key/proxy?** No. **How many domains?** Up to `maxItems` (default 100, max 1000) per run. **Which resolver?** Google DNS-over-HTTPS, with Cloudflare as automatic fallback.

### 🛟 Support

Found a bug or need an extra record type? Open an issue on the actor — fixes and new fields ship fast.

### Legal & privacy

Uses the public Google and Cloudflare DNS-over-HTTPS resolvers. Only public DNS data is returned.

***

**Keywords:** dns records scraper, dns lookup, dns-over-https, mx records, txt spf dkim, nameserver ns, cname soa caa, recon security migration monitoring, JSON CSV Excel

# Actor input Schema

## `mode` (type: `string`):

Lookup mode. Only 'domains' is supported: resolve all requested record types for each domain and emit one dataset item per domain.

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

List of domains (or hostnames) to resolve, e.g. 'google.com'. One dataset item is produced per domain.

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

Which DNS record types to query per domain. Supported: A, AAAA, MX, TXT, NS, CNAME, SOA, CAA.

## `maxItems` (type: `integer`):

Maximum number of domains to resolve (safety cap on the input list).

## Actor input object example

```json
{
  "mode": "domains",
  "domains": [
    "google.com",
    "github.com"
  ],
  "recordTypes": [
    "A",
    "AAAA",
    "MX",
    "TXT",
    "NS",
    "CNAME"
  ],
  "maxItems": 100
}
```

# Actor output Schema

## `records` (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": [
        "google.com",
        "github.com"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/dns-records-scraper").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": [
        "google.com",
        "github.com",
    ],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/dns-records-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "google.com",
    "github.com"
  ],
  "maxItems": 100
}' |
apify call ninhothedev/dns-records-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ninhothedev/dns-records-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/Q4rlfJiFt5D7ihi71/builds/vsyHun1vlXbG59f6h/openapi.json
