Free DNS Lookup API · All record types · JSON

DNS Lookup API — every record type in one call.

A, AAAA, MX, TXT, NS, CNAME, SOA records — all resolved in parallel and returned as structured JSON for any domain. Replace dig, nslookup, dnspython, and custom resolver scripts with one HTTP call. Cached, fast, normalized.

1,000 free requests/mo No credit card required Parallel resolution · <200ms cached
Try it

See it work with any domain.

Type any domain to see the live DNS records response from the API. Free, no signup — rate-limited to 5 lookups/day per browser.

GET /domain/{d}/dns
Try: cloudflare.comgithub.comvercel.comstripe.com 0 / 5 today
// Click "Run lookup" to see the live API response for this endpoint
Want everything in one call?
Use /lookup/{domain} to get WHOIS + DNS + SSL + subdomains + email security in a single REST call. Same API key, same pricing, same response format — just bundled. Great for lead enrichment, fraud detection, full domain audits.
See the all-in-one endpoint →
Why this DNS API

All record types. One call. Real-time data.

Most DNS libraries require one call per record type and force you to handle TTL caching, timeout retries, and edge cases per resolver. This API does all of that and gives back clean JSON.

7 record types in parallel
A, AAAA, MX, TXT, NS, CNAME, SOA resolved concurrently via async resolver. Total response time bounded by the slowest single record type, not the sum of all.
Cached for performance
Successful responses cached in Redis for 5 minutes. Cached responses return in <100ms; fresh queries typically 80-200ms depending on domain authoritative server latency.
Normalized JSON output
Each record type returned as a clean array of strings. No raw dig output to parse. Empty arrays for record types the domain doesn't have, so consuming code is consistent.
Long TXT records handled
SPF, DKIM, domain verification tokens, and other long TXT records returned in full. TCP fallback used automatically when responses exceed UDP MTU.
Resolver fallback
Primary local resolver with public resolver fallback (1.1.1.1, 8.8.8.8, 9.9.9.9) under high concurrent load or upstream timeouts. Resilient to single-resolver outages.
Bundled with full domain intel
Get just DNS via /domain/{d}/dns, or grab DNS + WHOIS + SSL + subdomains + email security in a single /lookup/{d} call. Same API key, same pricing.
Response shape

All record types. One JSON object.

Below: a real response for cloudflare.com. Each record type is an array of strings (empty if the domain has no records of that type).

GET/domain/cloudflare.com/dns
{
  "domain": "cloudflare.com",
  "A": ["104.16.132.229", "104.16.133.229"],
  "AAAA": ["2606:4700::6810:84e5", "2606:4700::6810:85e5"],
  "MX": [
    "10 mailstream-east.mxrecord.io",
    "10 mailstream-west.mxrecord.io",
    "20 mailstream-central.mxrecord.mx"
  ],
  "NS": [
    "ns3.cloudflare.com",
    "ns4.cloudflare.com",
    "ns5.cloudflare.com",
    "ns6.cloudflare.com",
    "ns7.cloudflare.com"
  ],
  "TXT": [
    "v=spf1 ip4:199.15.212.0/22 include:_spf.google.com ~all",
    "google-site-verification=...",
    "facebook-domain-verification=..."
  ],
  "CNAME": [],
  "SOA": ["ns3.cloudflare.com dns.cloudflare.com 2363924133 10000 2400 604800 1800"]
}
Code examples

One HTTP call. Any language.

Authenticate with your RapidAPI key, then call GET /domain/{domain}/dns. Below: cURL, Python, Node.js, and PHP.

curl "https://domain-intelligence-api.p.rapidapi.com/domain/cloudflare.com/dns" \
  -H "X-RapidAPI-Host: domain-intelligence-api.p.rapidapi.com" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY"
import requests

domain = "cloudflare.com"
url = f"https://domain-intelligence-api.p.rapidapi.com/domain/{domain}/dns"
headers = {
    "X-RapidAPI-Host": "domain-intelligence-api.p.rapidapi.com",
    "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
}
r = requests.get(url, headers=headers, timeout=15)
dns = r.json()
print("A records:", dns["A"])
print("MX records:", dns["MX"])
// Node 18+ has built-in fetch — no import needed
const domain = "cloudflare.com";
const res = await fetch(
  `https://domain-intelligence-api.p.rapidapi.com/domain/${domain}/dns`,
  { headers: {
      "X-RapidAPI-Host": "domain-intelligence-api.p.rapidapi.com",
      "X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
  }}
);
const dns = await res.json();
console.log("A:", dns.A, "MX:", dns.MX);
<?php
$domain = "cloudflare.com";
$ch = curl_init("https://domain-intelligence-api.p.rapidapi.com/domain/$domain/dns");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "X-RapidAPI-Host: domain-intelligence-api.p.rapidapi.com",
    "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY",
]);
$dns = json_decode(curl_exec($ch), true);
curl_close($ch);
echo "First A: " . $dns["A"][0];
Use cases

Common things people build with this DNS API.

The most common workflows that benefit from programmatic, all-record-types DNS access.

DNS propagation monitoring
After a DNS change, verify propagation by polling the API and watching for the new records to appear. Useful for SaaS platforms onboarding customer domains or for migration playbooks.
Mail server discovery
Pull MX records to identify a domain's mail provider (Google Workspace, Microsoft 365, ProtonMail, custom self-hosted). Useful for sales segmentation, email deliverability tooling, and security analysis.
Infrastructure inventory
Audit your domain portfolio: which IPs are A records pointing to, are nameservers consistent, what TXT verification tokens are live? Catch drift between intended and actual DNS state.
SaaS onboarding checks
When a customer adds a custom domain to your platform, validate that A/CNAME records point to your service and TXT verification records exist. Cut onboarding friction.
DNS change alerting
Run a scheduled job that compares today's DNS records to yesterday's. Alert on unexpected changes — useful for security teams catching DNS hijack attempts or for IT teams catching unauthorized changes.
CDN / hosting fingerprinting
A and CNAME records often reveal hosting providers (Cloudflare, AWS, Vercel, Netlify, Fastly). Useful for lead enrichment, competitor analysis, or tech-stack reporting.
Pricing

Pay only for what you use.

Billed monthly via RapidAPI. Same pricing across all endpoints (DNS, WHOIS, SSL, subdomains, email security, and bundled /lookup). Cancel anytime.

BASIC
$0/mo
For evaluation, side projects, and low-volume monitoring.
  • 1,000 requests / month
  • All endpoints included
  • No credit card required
Start free
Most popular
PRO
$9.99/mo
For production apps doing real volume. Sweet spot for most teams.
  • 50,000 requests / month
  • Higher rate limits
  • Email support
Choose PRO
ULTRA
$39.99/mo
For SaaS platforms with embedded domain features.
  • 500,000 requests / month
  • SLA: 99.9% uptime
  • Priority support
Choose ULTRA
MEGA
$149.99/mo
For data platforms, security vendors, and high-volume workloads.
  • 5,000,000 requests / month
  • Highest concurrency
  • Dedicated support
Choose MEGA
FAQ

Frequently asked questions.

Quick answers to common developer questions about the DNS API.

Is your DNS Lookup API free?+
Yes. Free tier includes 1,000 requests per month with no credit card required. Paid tiers start at $9.99/mo for 50,000 requests if you need higher volume.
Which DNS record types are returned?+
All major record types in one call: A (IPv4), AAAA (IPv6), MX (mail servers), TXT (text records including SPF/DKIM/verification tokens), NS (nameservers), CNAME (aliases), and SOA (start of authority). All resolved in parallel for fastest response time.
How is this different from doing dig or nslookup?+
dig and nslookup return one record type per command in text format that you have to parse. Our API returns all record types in a single HTTP call as structured JSON. Better for automation, monitoring scripts, and any code that needs to consume DNS data programmatically without subprocess calls or text parsing.
How fresh is the data?+
Live by default. Each request resolves DNS in real-time. We cache successful responses for 5 minutes to absorb burst traffic and reduce resolver load. For DNS data, 5 minutes is generally well within typical TTL ranges, so cached data remains fresh.
Can I query specific record types only?+
The /domain/{d}/dns endpoint returns all types in one call — usually what you want for the price of one API call. If you only need one record type, filter the response client-side. The all-in-one approach is generally faster than multiple targeted queries due to parallel resolution.
What's the rate limit?+
Free tier: 1,000/mo. Pro: 50,000/mo. Ultra: 500,000/mo. Mega: 5M/mo. Per-second rate limits are generous on all tiers — the monthly request count is the meaningful constraint.
Does this do reverse DNS (PTR) lookups?+
PTR records are not currently returned (the API focuses on forward DNS for a given domain). For reverse DNS lookups on specific IPs, use a standard resolver against the in-addr.arpa zone, or open a feature request on our GitHub.
What resolvers does the API use?+
Authoritative DNS via the server's local resolver, with public resolver fallback (1.1.1.1, 8.8.8.8, 9.9.9.9) under high concurrent load. All resolved over UDP with TCP fallback for large responses (DNSSEC, long TXT records, large MX lists).

Ship a DNS feature this afternoon.

Free tier · No credit card · All endpoints included

Get your API key →