# DNS Lookup (`superlativetech/dns-lookup`) Actor

Bulk DNS records lookup. Query MX, SPF, DMARC, DKIM, TXT, CNAME, A, AAAA, NS, SOA and reverse DNS for any domain or IP. Batch thousands or query one instantly using the Standby API. For domain registration data, see WHOIS Lookup.

- **URL**: https://apify.com/superlativetech/dns-lookup.md
- **Developed by:** [Superlative](https://apify.com/superlativetech) (community)
- **Categories:** Developer tools, Automation, Open source
- **Stats:** 128 total users, 11 monthly users, 100.0% runs succeeded, 7 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 Lookup

Retrieve DNS records for any domain. Supports A, AAAA, MX, CNAME, TXT, NS, SOA, DMARC records and reverse lookups.

### What does DNS Lookup do?

DNS Lookup retrieves DNS records for a list of domain names, or performs reverse DNS lookups from IP addresses.

- **All common record types** — A, AAAA, MX, CNAME, TXT, NS, SOA, DMARC
- **Reverse lookups** — Map IP addresses back to hostnames (PTR records)
- **Selective queries** — Choose specific record types or get them all
- **Batch processing** — Query hundreds or thousands of domains at once
- **[Instant API mode](#standby-mode-instant-api)** — Sub-second single-domain lookups via Standby HTTP server

### Use with AI Agents

Available as an MCP tool via the [Apify MCP Server](https://mcp.apify.com).

| Property | Value |
| --- | --- |
| Actor ID | `superlativetech/dns-lookup` |
| Standby URL | `https://superlativetech--dns-lookup.apify.actor` |
| Input | `domains` (string\[]) or `domain` (string). Optional: `dnsRecordTypes`, `reverseLookup` |
| Output | `{domain, A[], AAAA[], MX[], TXT[], NS[], SOA[], CNAME[]}` per domain |
| Pricing | Free — you only pay standard Apify platform usage |
| Idempotent | Yes — same input always produces same output |

#### Output schema

```json
{ "domain": "example.com", "A": [{"value": "93.184.216.34", "ttl": 300}], "MX": [{"priority": 10, "value": "mail.example.com"}] }
```

#### Pipeline composability

Use DNS Lookup for domain intelligence pipelines:

1. **Extract domains** (from URLs/emails) → 2. **DNS Lookup** (this actor) → 3. **WHOIS Lookup** (registration data)

#### Standby (instant API)

```
GET https://superlativetech--dns-lookup.apify.actor?token=TOKEN&domain=example.com
GET https://superlativetech--dns-lookup.apify.actor?token=TOKEN&domain=example.com&type=MX,TXT
```

### Why look up DNS records?

DNS records reveal infrastructure details that aren't visible on a website:

- **Email providers** — MX records show if they use Google Workspace, Microsoft 365, or custom mail servers
- **Hosting providers** — A records point to AWS, Cloudflare, or other infrastructure
- **Security posture** — TXT records reveal SPF, DKIM, and DMARC configurations
- **Technology stack** — CNAME records expose CDNs, marketing tools, and services

> **Need domain registration data?** [WHOIS Lookup](https://apify.com/superlativetech/whois-lookup?fpr=8e9l1) returns registrar, creation and expiry dates, domain age, registrant info, name servers, and DNSSEC status.

#### Use cases

**Technical:**

- DNS auditing and validation
- DNS propagation troubleshooting
- Domain migration checks
- Infrastructure and email provider identification
- IP-to-hostname mapping (PTR)

**Sales & Marketing:**

- Identify email hosting providers for targeted outreach
- Recognize DNS patterns linked to specific technologies
- Analyze competitor DNS infrastructure
- Discover technology stacks used by prospects

### How to use DNS Lookup

1. Enter your domain names (without `https://` or `www.`)
2. Optionally select specific record types
3. Click **Start** and download your results

#### Standard DNS lookup

Provide domain names to retrieve their DNS records.

```json
{
  "domains": ["example.com", "apify.com"],
  "dnsRecordTypes": ["A", "MX"]
}
```

#### Reverse DNS lookup

Provide IP addresses with `reverseLookup: true` to get hostnames.

```json
{
  "domains": ["8.8.8.8", "1.1.1.1"],
  "reverseLookup": true
}
```

### Standby mode (instant API)

Standby mode keeps a warm container running so you get instant DNS lookups without cold-start delays. Instead of starting a full Actor run, you make a simple HTTP GET request and get results in milliseconds.

This is ideal for:

- **Clay enrichment steps** — single-domain lookups inline
- **Make / n8n HTTP modules** — real-time DNS checks in workflows
- **MCP agents** — AI tools that need instant DNS data

#### Standby URL

```
https://superlativetech--dns-lookup.apify.actor?token=YOUR_API_TOKEN
```

Or use a Bearer token in the `Authorization` header instead of the `token` query parameter.

#### Forward lookup

Look up all record types for a domain:

```bash
curl "https://superlativetech--dns-lookup.apify.actor/?token=YOUR_API_TOKEN&domain=apify.com"
```

Look up specific record types:

```bash
curl "https://superlativetech--dns-lookup.apify.actor/?token=YOUR_API_TOKEN&domain=google.com&type=MX,TXT"
```

Include DMARC records:

```bash
curl "https://superlativetech--dns-lookup.apify.actor/?token=YOUR_API_TOKEN&domain=google.com&type=MX,TXT,DMARC"
```

#### Reverse lookup

Map an IP address back to its hostname:

```bash
curl "https://superlativetech--dns-lookup.apify.actor/?token=YOUR_API_TOKEN&ip=8.8.8.8"
```

#### Query parameters

| Parameter | Required | Description |
| --- | --- | --- |
| `domain` | Yes (unless `ip`) | Domain name to look up |
| `ip` | Yes (unless `domain`) | IP address for reverse lookup |
| `type` | No | Comma-separated record types (defaults to all). Valid: A, AAAA, CNAME, MX, TXT, NS, SOA, DMARC |

#### Response format

Success — same shape as batch output:

```json
{
  "domain": "apify.com",
  "dnsRecords": [
    { "type": "A", "ttl": 300, "address": "93.184.216.34" }
  ],
  "status": "Success"
}
```

#### Error responses

| Code | Cause |
| --- | --- |
| 400 | Missing `domain`/`ip`, both provided, invalid domain/IP, invalid record type |
| 405 | Non-GET request |
| 500 | Unexpected server error |

DNS failures (e.g., domain exists but has no MX records) return HTTP 200 with `"status": "No records"` — consistent with batch mode.

### How many domains can you query?

There's no limit. Query as many domains as you need — from a handful to hundreds of thousands. The Actor scales automatically.

For best performance, batch your requests. Processing 1,000 domains at once is more efficient than 10 separate runs of 100 domains each.

### How much will it cost you?

This Actor is **free to use** — there are no per-result charges. You only pay for the Apify platform compute your runs consume, which is typically negligible.

### Input parameters

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `domains` | array | — | List of domain names or IP addresses to query |
| `dnsRecordTypes` | array | All types | Specific DNS record types to retrieve (ignored for reverse lookups) |
| `reverseLookup` | boolean | `false` | Set to `true` for reverse (PTR) lookups using IP addresses |

#### Available record types

- `A` — IPv4 addresses
- `AAAA` — IPv6 addresses
- `MX` — Mail servers
- `CNAME` — Canonical names (aliases)
- `TXT` — Text records (SPF, DKIM, verification)
- `NS` — Name servers
- `SOA` — Start of authority
- `DMARC` — Email authentication policy (queries `_dmarc` subdomain automatically)

### During the Actor run

The Actor queries DNS servers for each domain in your list. You'll see progress updates as lookups complete.

If you provide invalid input (e.g., an empty list or URLs with protocols), the Actor will stop with an error message.

Results are available in real-time — you can start downloading records before the full run completes.

### Output format

Results are saved to the default dataset. Each domain is a separate item.

#### Standard lookup output

```json
[
  {
    "domain": "example.com",
    "dnsRecords": [
      { "type": "A", "ttl": 300, "address": "93.184.216.34" },
      { "type": "MX", "ttl": 3600, "exchange": "mail.example.com", "priority": 10 }
    ],
    "status": "Success"
  }
]
```

#### Reverse lookup output

```json
[
  {
    "domain": "8.8.8.8",
    "dnsRecords": [
      { "type": "PTR", "hostname": "dns.google" }
    ],
    "status": "Success"
  }
]
```

| Field | Description |
| --- | --- |
| `domain` | The queried domain or IP address |
| `dnsRecords` | Array of DNS records found |
| `status` | "Success" or error message |

### Integrations

DNS Lookup works with any tool that can call Apify Actors:

- **Clay** — Add as an enrichment step in your Clay tables
- **Make** — Use the Apify module to run the Actor
- **Zapier** — Trigger runs and retrieve results automatically
- **n8n** — Self-hosted workflow automation

You can also use webhooks to trigger actions when a run completes.

### Using DNS Lookup with the Apify API

The Apify API gives you programmatic access to run Actors, retrieve results, and manage datasets.

**Node.js:**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('superlativetech/dns-lookup').call({
  domains: ['apify.com', 'google.com'],
  dnsRecordTypes: ['A', 'MX', 'TXT']
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python:**

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_API_TOKEN')

run = client.actor('superlativetech/dns-lookup').call(run_input={
    'domains': ['apify.com', 'google.com'],
    'dnsRecordTypes': ['A', 'MX', 'TXT']
})

items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

Check out the [Apify API reference](https://docs.apify.com/api) for full details, or click the **API** tab above for more code examples.

### Your feedback

We're always improving our Actors. If you have feature requests, find a bug, or need help with a specific use case, please [open an issue](https://console.apify.com/actors/BbYlowTcEOmqzZ6uW/issues) in the Actor's Issues tab.

When Apify asks to share your run data with us, we encourage you to opt in — it's the fastest way for us to spot edge cases and improve results. Sharing is completely optional (you can toggle it anytime under [Account Settings → Privacy](https://console.apify.com/account#/privacy)), and shared runs are automatically deleted by Apify based on your plan's data retention period. We only use shared data to debug issues and improve this Actor.

### Leave a review

If DNS Lookup helps with your workflows, please [leave a review](https://console.apify.com/actors/BbYlowTcEOmqzZ6uW). Your feedback helps other users discover the tool and helps us understand what's working well.

***

### More from Superlative

- **[WHOIS Lookup](https://apify.com/superlativetech/whois-lookup?fpr=8e9l1)** — Domain registration data: registrar, dates, domain age, registrant, name servers
- **[HTTP API](https://apify.com/superlativetech/http-api?fpr=8e9l1)** — General-purpose HTTP request utility

Built by Superlative

# Actor input Schema

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

Domain names (without protocol prefixes like https://) for standard DNS lookup or IP addresses for reverse DNS lookup.

## `dnsRecordTypes` (type: `array`):

Specific DNS record types to retrieve (e.g., A, MX, TXT). Ignored for reverse DNS lookups.

## `reverseLookup` (type: `boolean`):

Set to true to perform reverse DNS lookups (IP to hostname). Domains array must contain valid IP addresses if enabled.

## Actor input object example

```json
{
  "domains": [
    "apify.com"
  ],
  "dnsRecordTypes": [
    "A",
    "AAAA",
    "MX",
    "TXT",
    "NS",
    "SOA",
    "CNAME"
  ],
  "reverseLookup": false
}
```

# 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"
    ],
    "dnsRecordTypes": [
        "A",
        "AAAA",
        "MX",
        "TXT",
        "NS",
        "SOA",
        "CNAME"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("superlativetech/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"],
    "dnsRecordTypes": [
        "A",
        "AAAA",
        "MX",
        "TXT",
        "NS",
        "SOA",
        "CNAME",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("superlativetech/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"
  ],
  "dnsRecordTypes": [
    "A",
    "AAAA",
    "MX",
    "TXT",
    "NS",
    "SOA",
    "CNAME"
  ]
}' |
apify call superlativetech/dns-lookup --silent --output-dataset

```

## MCP server setup

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