# DNS Records Lookup – Bulk A, MX, TXT, NS, CAA, SRV (`adamplaenitz/dns-records-lookup`) Actor

Bulk DNS lookup for lists of domains: A, AAAA, CNAME, MX, TXT, NS, SOA, CAA and SRV records with TTLs, plus mail provider (Google, Microsoft …), DNS host, SPF and verification-token detection. System, Cloudflare, Google, Quad9 or own resolver.

- **URL**: https://apify.com/adamplaenitz/dns-records-lookup.md
- **Developed by:** [Adam Plänitz](https://apify.com/adamplaenitz) (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.00 / 1,000 resolved domains

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 – Bulk A, MX, TXT, NS, CAA, SRV

**Look up the DNS records of hundreds or thousands of domains in one run: A, AAAA, CNAME, MX, TXT, NS, SOA, CAA and SRV – with TTLs, plus ready-made flags such as IPv6 support, mail provider (Google Workspace, Microsoft 365, Proofpoint …), DNS hosting provider (Cloudflare, Route 53, Azure …), SPF record and the services a domain has verified itself with (Google, Microsoft, Atlassian, OpenAI …).** Export as JSON, CSV or Excel, or connect to Google Sheets, Make, Zapier, n8n or webhooks.

### What does it do?

For every domain or host name in your list the Actor sends the selected DNS queries (in parallel) and returns one clean item:

- **Records:** `A` and `AAAA` (with TTL), `CNAME`, `MX` (sorted by priority), `TXT` (multi-string records joined), `NS`, `SOA` (serial, refresh, retry, expire, minimum TTL), `CAA` (flags, tag, value) and `SRV` for service prefixes such as `_sip._tls` or `_autodiscover._tcp`.
- **Quick columns:** `ipv4`, `ipv6`, `cname`, `mxHosts`, `nameservers`.
- **Derived flags:** `hasIPv4`, `hasIPv6`, `hasMx`, `nullMx` (domain declares that it accepts no mail), `hasSpf`, `spfRecord`, `multipleSpfRecords` (an SPF error), `hasCaa`, `caaIssuers`, lowest `ttlA` / `ttlAAAA`.
- **Provider detection (heuristic):**
  - `mailProvider` from the MX hosts – about 50 providers and mail gateways (Google Workspace, Microsoft 365, Zoho, Proton, iCloud, Fastmail, Mimecast, Proofpoint, Cisco, Barracuda, Amazon SES, IONOS, STRATO, Hetzner, OVHcloud …), `self-hosted` if the mail server belongs to the domain itself, `other (<domain>)` otherwise, `no mail (null MX)`.
  - `dnsProvider` from the NS records – about 60 providers (Cloudflare, Amazon Route 53, Google Cloud DNS, Azure DNS, Akamai, NS1, UltraDNS, GoDaddy, Namecheap, Hetzner, IONOS, Gandi, Vercel, Netlify, Alibaba, DNSPod …).
  - `cnameHostingHint` from the CNAME target (CloudFront, Akamai, Fastly, Azure, GitHub Pages, Vercel, Netlify, Shopify, Heroku …).
  - `txtVerifications`: services the domain was verified with, read from the TXT records (Google, Microsoft, Facebook/Meta, Apple, Atlassian, Adobe, DocuSign, Zoom, Slack, Stripe, HubSpot, OpenAI, Anthropic, Shopify …) – a quick look at a company's SaaS stack.
- **Two output modes:** one item per domain (default) or **one row per record** (`recordType`, `name`, `value`, `ttl`, `priority`) – ideal for spreadsheets and diffs.
- **Resolver of your choice:** the platform's system resolver, Cloudflare (1.1.1.1), Google Public DNS (8.8.8.8), Quad9 (9.9.9.9) or your own public resolver IPs – useful for checking propagation after a DNS change.

#### Status values

| `status` | Meaning | Charged |
|---|---|---|
| `resolved` | At least one of the requested records exists | yes |
| `nxdomain` | The domain does not exist | no |
| `no-records` | The name exists but has none of the requested record types | no |
| `error` | All queries failed (timeout, SERVFAIL, refused) – see `queryErrors` | no |
| `invalid-input` | Not a valid domain name (IP addresses, local names) | no |

If only some queries fail (e.g. a TXT timeout), the item is still `resolved` and the failed types are listed in `queryErrors`.

### Who is it for?

- **Sales and marketing teams:** enrich lead lists with mail provider (Google vs. Microsoft), DNS/hosting provider and verified SaaS tools.
- **IT, DevOps and hosting providers:** audit customer domains, check IPv6 and CAA coverage, find domains still pointing to old servers, check propagation on a chosen resolver.
- **Security and compliance teams:** inventory MX, SPF and CAA across a domain portfolio.
- **Domain investors and researchers:** bulk-check which domains exist and where they are hosted.

### Input

| Field | Default | Description |
|---|---|---|
| Domains or host names | – | `example.com`, `www.example.com`, `_dmarc.example.com` or a URL (host name is used). Lower-cased, punycode for IDNs, duplicates removed. |
| Record types | A, AAAA, CNAME, MX, TXT, NS, SOA, CAA | Any of A, AAAA, CNAME, MX, TXT, NS, SOA, CAA, SRV. |
| SRV service prefixes | 15 common services | e.g. `_sip._tls`, `_autodiscover._tcp`, `_xmpp-client._tcp` – only used when SRV is selected. |
| Output mode | one item per domain | or one row per record. Billing is per resolved domain in both modes. |
| DNS resolver | system | system, Cloudflare, Google, Quad9 or custom. |
| Custom resolver addresses | – | Public IPv4/IPv6 addresses, optionally with port (`9.9.9.9`, `[2620:fe::fe]:53`). |
| Parallel domains | 10 | 1–50. |
| Query timeout | 5 s | Per attempt; every query is retried once on timeout / SERVFAIL. |

### Output example (shortened)

```json
{
  "input": "github.com",
  "domain": "github.com",
  "status": "resolved",
  "recordCount": 42,
  "ipv4": ["140.82.114.3"],
  "ipv6": [],
  "cname": null,
  "mxHosts": ["github-com.mail.protection.outlook.com"],
  "nameservers": ["dns1.p08.nsone.net", "dns2.p08.nsone.net", "…", "ns-1283.awsdns-32.org", "ns-520.awsdns-01.net"],
  "hasIPv4": true,
  "hasIPv6": false,
  "hasMx": true,
  "nullMx": false,
  "mailProvider": "Microsoft 365",
  "dnsProvider": "NS1 (IBM)",
  "dnsProviders": ["NS1 (IBM)", "Amazon Route 53"],
  "hasSpf": true,
  "spfRecord": "v=spf1 ip4:192.30.252.0/22 include:spf.protection.outlook.com include:_netblocks.google.com … ~all",
  "multipleSpfRecords": false,
  "txtVerifications": ["Google", "Jamf", "Loom", "Miro", "OpenAI", "Shopify", "Stripe", "Microsoft", "Atlassian", "…"],
  "hasCaa": true,
  "caaIssuers": ["globalsign.com", "letsencrypt.org", "sectigo.com", "digicert.com"],
  "ttlA": 23,
  "records": {
    "A": [{ "address": "140.82.114.3", "ttl": 23 }],
    "MX": [{ "priority": 0, "exchange": "github-com.mail.protection.outlook.com" }],
    "SOA": { "primaryNameServer": "dns1.p08.nsone.net", "serial": 1656468023, "refresh": 43200, "retry": 7200, "expire": 1209600, "minimumTtl": 3600 },
    "CAA": [{ "flags": 0, "tag": "issue", "value": "globalsign.com" }, "…"],
    "TXT": ["…"], "NS": ["…"], "AAAA": [], "CNAME": []
  },
  "queryErrors": null,
  "resolver": "system",
  "checkedAt": "2026-11-17T21:05:23.425Z",
  "error": null
}
```

Per-record mode (one row per record):

```json
{ "domain": "microsoft.com", "status": "resolved", "recordType": "SRV", "name": "_sip._tls.microsoft.com", "value": "100 1 443 sipdir.online.lync.com", "ttl": null, "priority": 100, "data": { "priority": 100, "weight": 1, "port": 443, "target": "sipdir.online.lync.com" } }
```

The **Overview** table shows domain, status, IPv4/IPv6, CNAME, MX, mail provider, name servers, DNS provider, SPF, verifications and CAA issuers. The key-value store record `RUN-SUMMARY` contains counts per status, mail and DNS provider, DNS query statistics and charged domains.

### Pricing and speed

See the **Pricing** tab. You pay per **resolved domain** (in both output modes, regardless of how many record types or records it has). **Domains that do not exist, names without any of the requested records, failed lookups and invalid inputs are free.** Duplicates are removed before querying.

DNS is fast: in a cloud test, the Tranco top 1,000 domains with the 8 default record types (about 8,000 queries) took about 40 seconds with the default 10 parallel domains and 256 MB memory. You can set a maximum cost per run – the Actor stops cleanly when it is reached.

### How it works, privacy and responsible use

- **Plain DNS only:** standard recursive DNS queries via Node.js (c-ares). No HTTP requests to the domains, no port scanning, no zone transfers.
- **No WHOIS / RDAP:** registrant data is never queried.
- **No personal data:** the SOA "responsible person" mailbox is not output, and the local part of e-mail addresses inside TXT and CAA values (e.g. `rua=mailto:…` or CAA `iodef`) is masked as `***@domain`.
- Provider names are **heuristics** based on host-name patterns; `other (<domain>)` means the provider is not in the list. Not affiliated with any of the named providers.
- Private, loopback and reserved resolver addresses as well as local host names are refused.

### Limits

- **TTL** is available for A and AAAA records only (a limitation of the Node.js resolver API); SOA contains the zone's minimum TTL.
- **CNAME:** only the first hop is shown in `cname`; A/AAAA answers already follow the full CNAME chain. Zone apexes normally have no CNAME.
- **DNSSEC** validation status is not checked.
- Answers come from the selected recursive resolver (cached answers can be up to one TTL old); authoritative servers are not queried directly. `ANY` queries are not used (RFC 8482).
- Very large TXT sets are returned completely; SRV is only queried for the given (or 15 default) service prefixes – SRV records cannot be listed without knowing the prefix.

Questions or feature requests? Please open an issue in the **Issues** tab.

# Actor input Schema

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

One entry per line: example.com, www.example.com, \_dmarc.example.com or a URL (the host name is used). Entries are normalised (lower case, punycode for international domains) and duplicates removed.

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

DNS record types to query for every name. SRV records are queried for the service prefixes below.

## `srvServices` (type: `array`):

Only used when SRV is selected. Prefixes in the form \_service.\_proto, e.g. \_sip.\_tls, \_autodiscover.\_tcp, \_xmpp-client.\_tcp. If empty, 15 common services (SIP, Autodiscover, XMPP, IMAPS, submission, CalDAV, CardDAV, LDAP, Kerberos, Matrix, Minecraft …) are checked.

## `outputMode` (type: `string`):

Per domain: one item per domain with all records and derived flags. Per record: one row per DNS record (type, name, value, TTL, priority) – handy for spreadsheets. Billing is per resolved domain in both modes.

## `resolver` (type: `string`):

Which recursive resolver answers the queries. System uses the resolver of the Apify platform.

## `customResolvers` (type: `array`):

Only used with resolver Custom. Public IPv4/IPv6 addresses, optionally with port, e.g. 1.1.1.1, 208.67.222.222, \[2620:fe::fe]:53. Private and reserved addresses are refused.

## `concurrency` (type: `integer`):

How many domains are resolved at the same time (1–50). All record types of a domain are queried in parallel.

## `timeoutSecs` (type: `integer`):

Timeout per DNS query attempt (1–30 s). Each query is sent up to twice by the resolver library and retried once more on timeout / SERVFAIL.

## Actor input object example

```json
{
  "domains": [
    "google.com",
    "microsoft.com",
    "apify.com",
    "wikipedia.org",
    "github.com"
  ],
  "recordTypes": [
    "A",
    "AAAA",
    "CNAME",
    "MX",
    "TXT",
    "NS",
    "SOA",
    "CAA"
  ],
  "outputMode": "perDomain",
  "resolver": "system",
  "concurrency": 10,
  "timeoutSecs": 5
}
```

# Actor output Schema

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

One item per domain with all requested records (or one row per record in per-record mode).

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

Counts per status, mail and DNS providers, DNS query statistics and charged domains.

# 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",
        "microsoft.com",
        "apify.com",
        "wikipedia.org",
        "github.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adamplaenitz/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": [
        "google.com",
        "microsoft.com",
        "apify.com",
        "wikipedia.org",
        "github.com",
    ] }

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

```

## MCP server setup

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