DNS Lookup API — seven record types in one call.
A, AAAA, MX, TXT, NS, CAA and SOA, resolved in parallel and returned as JSON. One HTTP call instead of dig, nslookup or a resolver script.
// Run a lookup to see the JSON response
Long arrays are shortened here. The API returns them in full.
curl "https://domain-intelligence-api.p.rapidapi.com/domain/example.com/dns" \
-H "X-RapidAPI-Host: domain-intelligence-api.p.rapidapi.com" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY"
import requests
domain = "example.com"
r = requests.get(
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",
},
timeout=15,
)
dns = r.json()
print("A records:", dns["A"])
print("MX records:", dns["MX"])
// Node 18+ (built-in fetch)
const res = await fetch(
"https://domain-intelligence-api.p.rapidapi.com/domain/example.com/dns",
{ headers: {
"X-RapidAPI-Host": "domain-intelligence-api.p.rapidapi.com",
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
} }
);
console.log(await res.json());
<?php
$ch = curl_init("https://domain-intelligence-api.p.rapidapi.com/domain/example.com/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",
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);
What you get
Seven types in parallel
All seven are queried at once, so the call takes as long as the slowest type, not the sum.
Predictable shape
Each type is an array of strings, empty when the domain has none. No dig output to parse.
Long TXT records in full
SPF, DKIM and verification tokens come back complete.
Cached for 5 minutes
Short enough for monitoring, long enough to absorb bursts. CNAME and PTR are not included.
Response fields
GET/domain/{domain}/dns returns one JSON object. The same object is the dns key of /lookup/{domain}.
| Field | Type | Meaning |
|---|---|---|
| A, AAAA | string[] | IPv4 and IPv6 addresses |
| MX | string[] | Priority and mail host, e.g. 10 mx.example.com. |
| TXT | string[] | Quoted TXT strings (SPF, verification tokens) |
| NS | string[] | Nameservers |
| CAA | string[] | Certificate authorities allowed to issue |
| SOA | string[] | Start of authority record |
Example response for stripe.com (arrays shortened)
{
"A": [
"198.137.150.231",
"198.202.176.231"
],
"AAAA": [],
"MX": [
"30 aspmx3.googlemail.com.",
"30 aspmx2.googlemail.com.",
"10 aspmx.l.google.com."
],
"TXT": [
"\"stripe-verification=82ce82470fb8324e19fa65abdb6fd370da5a8f90bba09712f259760f625d0790\"",
"\"vercel-domain-verification-0x8270=XezzJjJYrYZwY6CahDneh2ruB\"",
"\"google-site-verification=ZgGi2-xDdfnaWxdfjn5AqtUS11jKWqSXAV_EHODFzdE\""
],
"NS": [
"ns-1087.awsdns-07.org.",
"ns-705.awsdns-24.net.",
"ns-1882.awsdns-43.co.uk."
],
"CAA": [
"0 issue \"digicert.com\"",
"0 iodef \"mailto:caa-violations@stripe.com\"",
"0 issue \"visa.com\""
],
"SOA": [
"ns-1882.awsdns-43.co.uk. awsdns-hostmaster.amazon.com. 1 900 900 1209600 3600"
]
}
What people build with it
Propagation monitoring
Poll after a DNS change and watch for the new records to appear.
Mail provider discovery
MX records show whether a domain uses Google Workspace, Microsoft 365 or its own servers.
Infrastructure inventory
Check where A records point and whether nameservers are consistent across your domains.
SaaS onboarding checks
Confirm a customer's A and TXT verification records before activating a custom domain.
DNS change alerting
Compare today's records with yesterday's and alert on unexpected changes.
Hosting fingerprinting
A and NS records hint at the CDN or DNS provider behind a domain.
Pricing
One key covers every endpoint, including /lookup with all five signals in one call. Billed monthly through RapidAPI.
Frequently asked questions
Is your DNS Lookup API free?
Yes. The free tier includes 1,000 requests a month with no credit card. Paid plans start at $9.99/mo for 50,000 requests.
Which DNS record types are returned?
Seven: A (IPv4), AAAA (IPv6), MX (mail servers), TXT (including SPF and verification tokens), NS (nameservers), CAA (allowed certificate authorities) and SOA (start of authority), resolved in parallel. CNAME and PTR records are not returned.
How is this different from doing dig or nslookup?
dig and nslookup return one record type per command, as text you have to parse. This API returns all seven types in one HTTP call as JSON, which is easier to use from code.
How fresh is the data?
An uncached request resolves live. Successful responses are cached for 5 minutes.
Can I query specific record types only?
The endpoint always returns all seven types; keep the ones you need in your code. Because they're resolved in parallel, this is about as fast as a single-type query.
What's the rate limit?
Limits are monthly, per plan: 1,000 requests on BASIC, 50,000 on PRO, 500,000 on ULTRA and 5,000,000 on MEGA. On paid plans, requests over the quota are billed at the overage rate.
Does this do reverse DNS (PTR) lookups?
No. The API covers forward DNS for a domain. For reverse lookups on an IP, query the in-addr.arpa zone with a standard resolver, or open a feature request on GitHub.
What resolvers does this use?
Queries go through the API server's recursive resolver, with a 3-second limit per record type.