DNS Lookup API: Query Any Record Type as JSON
Shelling out to dig or nslookup from application code is brittle and hard to do in serverless or browser contexts.
Query any DNS record type for a domain over a plain HTTPS GET and get clean JSON back.
Look up MX records
curl -G "https://dns-lookup22.p.rapidapi.com/dns/records" \
-d "domain=github.com" -d "type=MX" \
-H "X-RapidAPI-Key: YOUR_KEY" \
-H "X-RapidAPI-Host: dns-lookup22.p.rapidapi.com"const res = await fetch(
"https://dns-lookup22.p.rapidapi.com/dns/records?domain=github.com&type=MX",
{ headers: {
"X-RapidAPI-Key": "YOUR_KEY",
"X-RapidAPI-Host": "dns-lookup22.p.rapidapi.com",
} }
);
const records = await res.json();Every common record type
Pass type to fetch A, AAAA, MX, TXT, NS, CNAME, or SOA records. Use it to verify email deliverability (MX plus SPF/DKIM in TXT), check domain configuration, or monitor changes.
Use cases
Validate that a customer's domain has correct MX records before enabling email, surface SPF and DMARC TXT records in an onboarding wizard, or build a lightweight DNS health check — all without running your own resolver.
Run it in production
DNS Lookup has a permanent free tier — 1,000 requests a month, no credit card. Paid plans start at $5/month for 100,000 requests.
FAQ
Which record types are supported?
A, AAAA, MX, TXT, NS, CNAME, and SOA. Pass the type query parameter.
Can I check email/SPF configuration?
Yes. Query TXT records for SPF, DKIM, and DMARC, and MX records for mail routing.
Is it usable from the browser?
Yes. It is a standard HTTPS GET callable from a backend or a front-end.