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.
Type any domain to see the live DNS records response from the API. Free, no signup — rate-limited to 5 lookups/day per browser.
// Click "Run lookup" to see the live API response for this endpoint
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.
/domain/{d}/dns, or grab DNS + WHOIS + SSL + subdomains + email security in a single /lookup/{d} call. Same API key, same pricing.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).
{
"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"]
}
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];The most common workflows that benefit from programmatic, all-record-types DNS access.
Billed monthly via RapidAPI. Same pricing across all endpoints (DNS, WHOIS, SSL, subdomains, email security, and bundled /lookup). Cancel anytime.
Quick answers to common developer questions about the DNS API.
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./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.in-addr.arpa zone, or open a feature request on our GitHub.Free tier · No credit card · All endpoints included
Get your API key →