Home / APIs / DNS Lookup

DNS Lookup API

Resolve DNS records (A, AAAA, MX, TXT, NS, CNAME, SOA) and reverse-lookup any IP — fast, no setup.

Get it on RapidAPI ↗

DNS Lookup resolves any domain's DNS records and reverse-looks-up IP addresses over a simple JSON API — no SDK, no setup, stateless. Get A, AAAA, MX, TXT, NS, CNAME, and SOA records, or the IPv4+IPv6 pair in a single call.

Records come back normalized and clean: MX sorted by priority, TXT chunks joined, SOA fully expanded. Great for email-deliverability checks, domain tooling, security scanners, and dashboards.

Endpoints

MethodPathDescription
GET/dns/records?domain=&type=A, AAAA, MX, TXT, NS, CNAME, or SOA records
GET/dns/lookup?domain=IPv4 (A) and IPv6 (AAAA) in one call
GET/dns/reverse?ip=Reverse DNS (PTR) hostnames for an IP

Quick start

cURL (via RapidAPI)
curl --url 'https://dns-lookup22.p.rapidapi.com/records?domain=github.com&type=MX' \
  --header 'X-RapidAPI-Key: YOUR_KEY' \
  --header 'X-RapidAPI-Host: dns-lookup22.p.rapidapi.com'
JavaScript (fetch)
const res = await fetch('https://dns-lookup22.p.rapidapi.com/records?domain=github.com&type=MX', {
  headers: {
    'X-RapidAPI-Key': 'YOUR_KEY',
    'X-RapidAPI-Host': 'dns-lookup22.p.rapidapi.com'
  }
});
const data = await res.json();
Example response
{
  "domain": "github.com",
  "type": "MX",
  "found": true,
  "records": [
    {
      "exchange": "aspmx.l.google.com",
      "priority": 1
    }
  ]
}

Pricing

Subscribe on RapidAPI. Start free; upgrade as you scale.

Basic
Free
1,000 requests / mo
Pro
$5 / mo
100,000 requests / mo
Ultra
$20 / mo
1,000,000 requests / mo
Mega
$50 / mo
2,000,000 requests / mo

Frequently asked questions

Which DNS record types are supported?

A, AAAA, MX, TXT, NS, CNAME, and SOA via /dns/records, plus a combined A+AAAA via /dns/lookup and reverse PTR via /dns/reverse.

Is reverse DNS supported?

Yes — /dns/reverse?ip= returns the PTR hostnames for any valid IPv4 or IPv6 address.

What happens if a domain has no records of that type?

You get a normal 200 response with found:false and an empty list — not an error.

Ready to build with DNS Lookup?

Grab your key on RapidAPI and start on the free tier.

Get it on RapidAPI ↗