# Domain DNS Lookup — A, AAAA, MX, NS, TXT & More (`omao/domain-dns`) Actor

Look up DNS records for any domain: A, AAAA, MX, NS, TXT, CNAME, SOA and CAA. One clean JSON row per domain with records grouped by type. Fast, no setup.

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

## Pricing

from $0.72 / 1,000 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/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

## Domain DNS Lookup — A, MX, TXT, NS & More to JSON

**Look up DNS records for any domain — as clean JSON.** Pass a list of domains and get back a tidy row per domain with records grouped by type: A, AAAA, MX, NS, TXT, CNAME, SOA and CAA. Fast, no setup, no anti-bot.

> AI-agent ready: this Actor is callable and payable by AI agents via [x402](https://docs.apify.com/platform/integrations/x402) (USDC on Base), no Apify account required.

A simple DNS API for infrastructure checks, email deliverability, security audits and monitoring.

### Who uses this

- 🛠️ **DevOps & infrastructure** — verify DNS config across many domains.
- 📧 **Email & deliverability** — check MX, SPF and DKIM (TXT) records.
- 🔐 **Security teams** — audit CAA, NS and TXT records at scale.
- 🔎 **Researchers & OSINT** — map a domain's DNS footprint.
- 🧑‍💻 **Developers** — a clean DNS lookup endpoint by domain.

### What you get — one clean row per domain

| Field | Description |
|---|---|
| `domain` | The domain looked up |
| `records` | Records grouped by type (A, AAAA, MX, NS, TXT, CNAME, SOA, CAA) |
| `recordCount` | Total records found |
| `inputDomain` | Domain as provided |
| `ok`, `scrapedAt` | Status & provenance |

### Example

**Input**

```json
{ "domains": ["apify.com", "github.com"], "recordTypes": ["A", "MX", "TXT", "NS"] }
```

**Output (one item)**

```json
{
  "domain": "apify.com",
  "records": {
    "A": ["104.26.0.5", "104.26.1.5"],
    "MX": ["10 aspmx.l.google.com"],
    "NS": ["ns1.example.com", "ns2.example.com"],
    "TXT": ["v=spf1 include:_spf.google.com ~all"]
  },
  "recordCount": 7
}
```

### Why this actor

- ✅ **All the record types** — A, AAAA, MX, NS, TXT, CNAME, SOA, CAA.
- 🗂️ **Grouped output** — records organized by type, ready to use.
- 🌐 **Many domains at once** — pass a list, get one combined dataset.
- ⚡ **Fast & affordable** — pay only per domain looked up. No setup, no anti-bot.
- 🛟 **Robust** — a bad domain never breaks the batch.

### Input options

- `domains` *(required)* — domains to look up.
- `recordTypes` — which record types to fetch (default: common set). E.g. `A`, `MX`, `TXT`, `NS`.

### FAQ

**Which record types are supported?** A, AAAA, MX, NS, TXT, CNAME, SOA and CAA.

**Can I check SPF/DKIM/DMARC?** Yes — those live in `TXT` records; request the `TXT` type.

**Can I look up many domains at once?** Yes — pass a list; each row carries its own domain and records.

**How fresh is the data?** Live DNS resolution on every run.

**Can I export to CSV/Excel/Google Sheets?** Yes — the dataset exports to JSON, CSV, Excel and HTML, or pull it via the API.

**What does it cost?** Pay-per-domain — you're only charged for domains actually looked up.

***

*Tip: schedule this on your domains and diff the records to get alerted when DNS changes.*

# Actor input Schema

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

Domains (or URLs) to look up DNS records for.

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

DNS record types to query. Leave empty for A, AAAA, MX, NS, TXT, CNAME.

## `healthCheckMode` (type: `boolean`):

Internal monitoring: resolve a canary domain and FAIL if broken (no billing).

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "https://github.com"
  ],
  "healthCheckMode": false
}
```

# Actor output Schema

## `records` (type: `string`):

DNS records for each domain, grouped by record type.

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("omao/domain-dns").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"] }

# Run the Actor and wait for it to finish
run = client.actor("omao/domain-dns").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": [
    "apify.com"
  ]
}' |
apify call omao/domain-dns --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/hju4eYWM03g4u7JtC/builds/skCWV5Mbc4XaRLmdj/openapi.json
