DNS Lookup avatar

DNS Lookup

Pricing

Pay per event

Go to Apify Store
DNS Lookup

DNS Lookup

DNS Lookup resolves all standard DNS record types for one or more domains. It returns structured data including IP addresses, mail servers, name servers, TXT records, and an email security analysis that checks for SPF and DMARC configuration.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

1

Monthly active users

a day ago

Last modified

Categories

Share

Look up DNS records for any domain — A, AAAA, MX, NS, TXT, CNAME, SOA, plus email security analysis (SPF, DMARC).

What does DNS Lookup do?

DNS Lookup resolves all standard DNS record types for one or more domains. It returns structured data including IP addresses, mail servers, name servers, TXT records, and an email security analysis that checks for SPF and DMARC configuration. Pass in raw URLs or bare domain names — the actor automatically strips protocols, paths, and www. prefixes, then deduplicates the list before performing parallel lookups.

Use it to audit DNS configuration, verify email security, monitor domain infrastructure, or enrich domain lists with technical metadata.

Use cases

  • IT administrators verifying DNS configuration after migrating domains to a new hosting provider or CDN
  • Email marketers auditing SPF and DMARC records across all sending domains before launching a campaign
  • Security analysts enriching threat intelligence feeds with DNS metadata for bulk domain lists
  • SEO professionals checking name servers, A records, and CNAME setups across client domain portfolios
  • DevOps engineers monitoring infrastructure DNS records as part of automated health checks

Why use DNS Lookup?

  • All record types in one call — A, AAAA, MX, NS, TXT, CNAME, and SOA records resolved simultaneously
  • Built-in email security analysis — SPF and DMARC detection without separate lookups
  • Batch processing — look up hundreds or thousands of domains in a single run
  • Automatic URL cleaning — paste full URLs and the actor extracts the domain for you
  • Deduplication — duplicate domains are removed before lookup, so you never pay twice
  • Pay-per-event pricing — costs scale with actual usage, starting at fractions of a cent per domain

Input parameters

ParameterTypeRequiredDefaultDescription
domainsstring[]YesList of domain names to look up. URLs are automatically cleaned (https://example.com/path becomes example.com). Duplicates are removed.

Example input

{
"domains": ["apify.com", "google.com", "github.com"]
}

Output example

Each domain produces one record with:

FieldDescription
domainThe queried domain name
aA records (IPv4 addresses)
aaaaAAAA records (IPv6 addresses)
mxMX records (mail servers with priority)
nsName servers
txtTXT records
cnameCNAME records
soaSOA record (authority info)
emailSecuritySPF/DMARC analysis
lookupTimeMsLookup duration in milliseconds
errorError message if lookup failed
queriedAtISO timestamp of the lookup
{
"domain": "apify.com",
"a": ["13.33.142.70", "13.33.142.109", "13.33.142.5", "13.33.142.35"],
"aaaa": [],
"mx": [
{ "priority": 1, "exchange": "aspmx.l.google.com" },
{ "priority": 5, "exchange": "alt1.aspmx.l.google.com" }
],
"ns": ["ns-1234.awsdns-56.org", "ns-789.awsdns-01.net"],
"txt": ["v=spf1 include:_spf.google.com ~all"],
"cname": [],
"soa": {
"nsname": "ns-1234.awsdns-56.org",
"hostmaster": "awsdns-hostmaster.amazon.com",
"serial": 1,
"refresh": 7200,
"retry": 900,
"expire": 1209600,
"minttl": 86400
},
"emailSecurity": {
"spf": "v=spf1 include:_spf.google.com ~all",
"dmarc": "v=DMARC1; p=reject; rua=mailto:dmarc@apify.com",
"hasSPF": true,
"hasDMARC": true
},
"lookupTimeMs": 45,
"error": null,
"queriedAt": "2026-02-28T12:00:00.000Z"
}

How to look up DNS records for a domain

  1. Go to DNS Lookup on Apify Store
  2. Enter one or more domain names or URLs (e.g., apify.com, https://google.com/page)
  3. Click Start and wait for the run to finish
  4. Review A, AAAA, MX, NS, TXT, CNAME, and SOA records plus email security analysis for each domain
  5. Download your results as JSON, CSV, or Excel from the Dataset tab

How much does it cost to look up DNS records?

DNS Lookup uses Apify's pay-per-event pricing:

EventCost
Run start$0.035
Per domain looked up$0.001

Examples:

  • 5 domains: $0.035 + 5 x $0.001 = $0.04
  • 100 domains: $0.035 + 100 x $0.001 = $0.135
  • 1,000 domains: $0.035 + 1,000 x $0.001 = $1.035

Using the Apify API

The Apify API lets you control DNS Lookup programmatically. Schedule runs, read datasets, manage webhooks, and more. See the Apify API reference for details.

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('automation-lab/dns-lookup').call({
domains: ['apify.com', 'google.com'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Python

from apify_client import ApifyClient
client = ApifyClient('<YOUR_API_TOKEN>')
run = client.actor('automation-lab/dns-lookup').call(run_input={
'domains': ['apify.com', 'google.com'],
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)

cURL

curl "https://api.apify.com/v2/acts/automation-lab~dns-lookup/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-X POST \
-H "Content-Type: application/json" \
-d '{"domains": ["apify.com", "google.com"]}'

Use with AI agents via MCP

DNS Lookup is available as a tool for AI assistants via the Model Context Protocol (MCP).

Setup for Claude Code

claude mcp add --transport http apify \
"https://mcp.apify.com?tools=automation-lab/dns-lookup"

Setup for Claude Desktop, Cursor, or VS Code

{
"mcpServers": {
"apify-dns-lookup": {
"url": "https://mcp.apify.com?tools=automation-lab/dns-lookup"
}
}
}

Example prompts

  • "Look up all DNS records for example.com"
  • "Get the MX and A records for these domains"
  • "Check the email security configuration for our company domains"

Learn more in the Apify MCP documentation.

Integrations

Connect DNS Lookup with other apps and services using Apify integrations. You can integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, n8n, and many more. You can also use webhooks to trigger actions whenever a run finishes — for example, sending a Slack alert when a domain's email security configuration changes or pushing results to a Google Sheet for reporting.

Tips and best practices

  • Paste URLs directlyhttps://example.com/page is cleaned to example.com, so you can copy-paste from spreadsheets or browser tabs without editing
  • Check email security first — the emailSecurity field gives you a quick pass/fail on SPF and DMARC without needing separate tools
  • Combine with scheduling — set up a daily or weekly schedule to monitor DNS changes across your domain portfolio
  • Export results flexibly — download output as JSON, CSV, or Excel from the dataset tab, or pipe it into another workflow via the API
  • Watch for errors — if a domain fails, the error field explains why (NXDOMAIN, timeout, etc.) while other domains still return results

FAQ

Can I look up subdomains like mail.example.com? Yes. Enter any valid hostname and the actor will resolve its DNS records. It works with subdomains, apex domains, and any publicly resolvable name.

What happens if a domain does not exist? The actor returns a result object for that domain with the error field set to the failure reason (typically NXDOMAIN). Other domains in the batch are not affected.

Is there a limit on the number of domains per run? There is no hard limit. The actor processes domains in parallel batches of 10, so even thousands of domains complete quickly. Costs scale linearly with the number of domains.

A domain shows an error but I can access it in my browser. Why? The most common cause is a DNS timeout from the Apify cloud resolver. This can happen with domains that have very slow authoritative nameservers. Try running the actor again -- transient DNS timeouts usually resolve on retry. Also check that you entered the domain correctly (e.g., example.com not example.com/page; though the actor does strip URLs automatically).

Why are the CNAME results empty for my domain? CNAME records are typically set on subdomains (e.g., www.example.com), not on root domains. If you are checking a root domain, an empty CNAME array is expected. Check the A or AAAA records instead, which hold the IP addresses for root domains.

Other DNS and domain tools