# DNS Lookup | Scrape Domain Records & Security Intelligence (`datascoutapi/dns-lookup`) Actor

DNS lookup scrapes 22 data points including 10 DNS records (A, AAAA, MX, TXT, NS, CNAME, SOA, SRV, PTR, CAA) + email security analysis ( SPF/DKIM/DMARC), SSL certificate checker, domain monitoring. Processes 100 domains per batch with security scoring.

- **URL**: https://apify.com/datascoutapi/dns-lookup.md
- **Developed by:** [halam](https://apify.com/datascoutapi) (community)
- **Categories:** Automation, SEO tools, MCP servers
- **Stats:** 10 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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 - Complete Domain Analysis Tool

**DNS Lookup** is a powerful domain analysis tool that provides comprehensive DNS record lookups, email security assessments, and website performance insights. Perfect for domain administrators, security professionals, and developers who need detailed DNS information and email security analysis.

### What is DNS Lookup?

DNS Lookup is an advanced domain analysis actor that goes beyond basic DNS queries. It performs deep DNS analysis, email security auditing, SSL certificate inspection, and global propagation testing - all in one comprehensive tool.

### Supported DNS Record Types

| Record Type | Description | Purpose |
|-------------|-------------|---------|
| **A** | IPv4 Address | Maps domain to IPv4 address |
| **AAAA** | IPv6 Address | Maps domain to IPv6 address |
| **MX** | Mail Exchange | Email server routing |
| **TXT** | Text Records | SPF, DKIM, DMARC, verification |
| **NS** | Name Server | Authoritative DNS servers |
| **CNAME** | Canonical Name | Domain aliases and redirects |
| **SOA** | Start of Authority | Zone configuration and settings |
| **SRV** | Service Records | Service location and ports |
| **PTR** | Pointer Records | Reverse DNS lookups |
| **CAA** | Certificate Authority | SSL certificate authorization |

*All record types are queried simultaneously for comprehensive domain analysis.*

### Key Features

#### 🔍 Complete DNS Record Analysis

- **10 DNS Record Types**: A, AAAA, MX, TXT, NS, CNAME, SOA, SRV, PTR, CAA records
- **12+ Advanced Features**: Propagation, TTL analysis, DNSSEC, email security, SSL inspection
- **Global DNS Propagation**: Tests across 10 major public DNS resolvers (Google, Cloudflare, Quad9, OpenDNS)
- **TTL Analysis**: Smart cache optimization recommendations

#### 📧 Advanced Email Security Assessment

- **SPF Record Analysis**: Validates Sender Policy Framework with mechanism parsing
- **DKIM Key Discovery**: Probes 5 common selectors (google, k1, s1, s2, default)
- **DMARC Policy Detection**: Automatic policy discovery and validation
- **Email Provider Identification**: Detects Google Workspace, Microsoft 365, Amazon SES, and more
- **Email Security Score**: Transparent 0-100 scoring system

#### 🔒 SSL Certificate & Security Analysis

- **SSL Certificate Details**: Issuer, expiration dates, subject alternative names
- **Security Headers Check**: HSTS, CSP, X-Frame-Options, and more
- **TLS Cipher Information**: Encryption protocols and cipher suites
- **Certificate Warnings**: Expiration alerts and security recommendations

#### ⚡ Performance & Connectivity Testing

- **IPv4/IPv6 Connectivity**: Tests both HTTP and HTTPS connections
- **Response Time Analysis**: Connection speed measurements
- **Server Information**: Web server identification and response codes

### How to Use DNS Lookup

#### Simple Input Format

```json
{
  "domains": ["example.com", "github.com", "https://www.google.com/"]
}
```

**Domain Limit:** Maximum 100 domains per run. For larger lists, split into multiple batches and run separately.

#### Flexible Domain Input

The tool accepts domains in any format:

- `example.com` - Basic domain
- `www.example.com` - With subdomain
- `https://example.com` - With protocol
- `http://www.example.com/path` - Full URLs

All formats are automatically normalized for consistent analysis.

#### Advanced Configuration Options

```json
{
  "domains": ["example.com"],
  "checkPropagation": true,
  "enableSslInspection": true,
  "performReverseLookup": true,
  "enableEnrichment": true,
  "checkPerformance": true,
  "checkSecurityHeaders": true,
  "enableDnssec": true
}
```

### Email Security Scoring System

Our transparent email security scoring (0-100 points):

- **25 points**: Valid SPF record with proper policy
- **25 points**: DMARC policy set to reject or quarantine
- **25 points**: DKIM records discovered
- **15 points**: Multiple MX servers for redundancy
- **10 points**: Optimal TTL configuration

*Unlike proprietary scoring systems, our methodology is completely transparent and published.*

### Sample Output

```json
{
  "domain": "example.com",
  "A": ["93.184.216.34"],
  "AAAA": ["2606:2800:220:1:248:1893:25c8:1946"],
  "MX": [{"exchange": "mail.example.com", "priority": 10}],
  "TXT": [["v=spf1 include:_spf.example.com ~all"]],
  "spf_analysis": {
    "policy": "softfail",
    "mechanisms": 2,
    "dns_lookups": 1,
    "warnings": null
  },
  "dmarc": {
    "policy": "quarantine",
    "pct": "100"
  },
  "dkim_probe": {
    "found": 2,
    "records": [
      {"selector": "google", "key_type": "RSA", "key_length": 2048}
    ]
  },
  "email_security_score": {
    "score": 85,
    "max_score": 100
  },
  "ssl_cert": {
    "issuer": "DigiCert Inc",
    "expires": "2024-12-15T23:59:59.000Z",
    "days_until_expiry": 365,
    "warning": null
  },
  "propagation": {
    "resolvers_checked": 10,
    "successful_queries": 10,
    "ttl_consistency": "consistent"
  }
}
```

### Use Cases

#### For Domain Administrators

- Monitor DNS propagation across global resolvers
- Validate email security configurations
- Track SSL certificate expiration dates
- Optimize TTL settings for performance

#### For Security Professionals

- Audit email authentication (SPF, DKIM, DMARC)
- Assess domain security posture
- Monitor SSL/TLS configurations
- Identify security header implementations

#### For Developers & DevOps

- Troubleshoot DNS resolution issues
- Verify deployment configurations
- Monitor website performance metrics
- Automate domain health checks

#### For Email Marketers

- Ensure email deliverability with proper authentication
- Monitor sender reputation factors
- Validate email infrastructure setup
- Improve inbox placement rates

### Why Choose DNS Lookup?

✅ **Comprehensive Analysis**: 22+ data points including DNS records and security analysis\
✅ **Email Security Focus**: Deep SPF, DKIM, DMARC analysis\
✅ **Global Testing**: 10 public DNS resolvers worldwide\
✅ **Performance Insights**: IPv4/IPv6 connectivity testing\
✅ **SSL Monitoring**: Certificate expiration and security alerts\
✅ **Transparent Scoring**: Published email security methodology\
✅ **Flexible Input**: Accepts any domain format\
✅ **Developer Friendly**: Clean JSON output for automation

### Getting Started

1. **Add domains** to analyze in the input field
2. **Configure options** for specific analysis needs
3. **Run the actor** and get comprehensive results
4. **Use the data** for monitoring, troubleshooting, or reporting

Perfect for continuous monitoring, security audits, email deliverability optimization, and DNS troubleshooting. Get complete domain insights with DNS Lookup today!

### Useful For

**System Administrators & DevOps:** DNS propagation testing, domain monitoring, SSL certificate tracking, performance optimization

**Security Professionals:** Domain security audits, email authentication validation, vulnerability assessments, compliance checks

**Email Marketers:** Deliverability optimization, SPF/DKIM/DMARC validation, sender reputation monitoring, inbox placement improvement

**Web Developers:** DNS troubleshooting, website security analysis, domain configuration verification, deployment validation

**IT Consultants:** Client domain assessments, security recommendations, email infrastructure audits, technical reporting

### 🔗 Other Actors

**DomainDaddy – Domain Intelligence & WHOIS Lookup**\
Provides domain availability and expiry dates, WHOIS & RDAP data, DNS records (A, MX, NS, TXT), IP geolocation, and ASN details. Calculates domain age, supports batch processing, and works with 70+ TLDs. Handles errors gracefully and delivers clean, structured JSON output.\
**Check it out:** https://apify.com/datascoutapi/domaindaddy

**Email Address Validator**\
Validates up to 10,000 emails per run. Performs bulk email validation with MX record checks, disposable and role-based email detection. Improves deliverability and reduces bounce rates using 5-layer validation, detailed reports, and smart DNS caching. Fast, accurate, and cost-effective email list cleaning.\
**Start free:** https://apify.com/datascoutapi/email-address-validator

### 📬 Contact & Support

Have questions, need help, or interested in a private or custom instance?\
Reach our team anytime at **datascoutapi@gmail.com**

# Actor input Schema

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

List of domains or URLs to analyze

## `checkPropagation` (type: `boolean`):

Test DNS propagation across 10 global resolvers

## `enableSslInspection` (type: `boolean`):

Analyze SSL certificates, expiry, and TLS configuration

## `performReverseLookup` (type: `boolean`):

Perform reverse DNS lookups for IP addresses

## `enableEnrichment` (type: `boolean`):

SPF/DKIM/DMARC analysis, MX provider detection, security scoring

## `checkPerformance` (type: `boolean`):

Test HTTP/HTTPS connectivity and response times

## `checkSecurityHeaders` (type: `boolean`):

Analyze HSTS, CSP, X-Frame-Options and other security headers

## `enableDnssec` (type: `boolean`):

Validate DNSSEC chain of trust

## Actor input object example

```json
{
  "domains": [
    "github.com"
  ],
  "checkPropagation": true,
  "enableSslInspection": true,
  "performReverseLookup": true,
  "enableEnrichment": true,
  "checkPerformance": true,
  "checkSecurityHeaders": true,
  "enableDnssec": true
}
```

# Actor output Schema

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

Complete DNS analysis results with all 22+ data points

# 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": [
        "github.com"
    ]
};

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

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

```

## MCP server setup

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