Compare DNS lookup APIs side-by-side. Resolve A, MX, TXT, CNAME, NS records programmatically. Find the best DNS API for monitoring, email validation, and security tools.
Every DNS API supports different record types. Here are the most common ones used in application development:
AIPv4 AddressAAAAIPv6 AddressMXMail ServersCNAMEAliasesTXTSPF/DKIM/DMARCNSNameserversSOAStart of AuthorityPTRReverse DNSSRVService RecordsFeature matrix across all 5 DNS lookup APIs. Scroll horizontally on mobile.
| Provider | Free Tier | Auth Required | Record Types | All Records at Once | Reverse DNS | Response Format |
|---|---|---|---|---|---|---|
| Google Public DNS FREE | Unlimited | No | All standard | No (1 type per query) | Yes (PTR) | JSON (DoH) |
| Cloudflare DNS FREE | Unlimited | No | All standard | No (1 type per query) | Yes (PTR) | JSON (DoH) |
| SecurityTrails FREEMIUM | 50 queries/mo | API key | All + historical | Yes | Yes | JSON |
| WhoisXML API FREEMIUM | 500 queries/mo | API key | All + WHOIS | Yes | Yes | JSON / XML |
| Frostbyte DNS 200 FREE CREDITS | 200 credits | API key | A, AAAA, MX, CNAME, TXT, NS, SOA | Yes (all in 1 call) | Yes | JSON |
Detailed analysis of each DNS API with strengths and weaknesses.
Enter any domain to see all DNS records. Uses the Frostbyte DNS API - no API key required for this demo.
Copy-paste examples for each provider. All return JSON.
curl "https://dns.google/resolve?name=example.com&type=A"
const res = await fetch('https://dns.google/resolve?name=example.com&type=A');
const data = await res.json();
console.log(data.Answer); // [{name, type, TTL, data}]import requests
r = requests.get('https://dns.google/resolve', params={'name': 'example.com', 'type': 'A'})
print(r.json()['Answer'])curl -H "accept: application/dns-json" \
"https://1.1.1.1/dns-query?name=example.com&type=MX"
const res = await fetch('https://1.1.1.1/dns-query?name=example.com&type=MX', {
headers: { accept: 'application/dns-json' }
});
const data = await res.json();
console.log(data.Answer);import requests
r = requests.get('https://1.1.1.1/dns-query',
params={'name': 'example.com', 'type': 'MX'},
headers={'accept': 'application/dns-json'})
print(r.json()['Answer'])curl "https://agent-gateway-kappa.vercel.app/v1/agent-dns/all/example.com" \
-H "x-api-key: YOUR_KEY"
const res = await fetch('https://agent-gateway-kappa.vercel.app/v1/agent-dns/all/example.com', {
headers: { 'x-api-key': 'YOUR_KEY' }
});
const data = await res.json();
// Returns: A, AAAA, MX, CNAME, TXT, NS, SOA — all at once
console.log(data.records);import requests
r = requests.get('https://agent-gateway-kappa.vercel.app/v1/agent-dns/all/example.com',
headers={'x-api-key': 'YOUR_KEY'})
data = r.json()
print(data['records']) # All record types in one responsepackage main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET",
"https://agent-gateway-kappa.vercel.app/v1/agent-dns/all/example.com", nil)
req.Header.Set("x-api-key", "YOUR_KEY")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}What each DNS API costs when you outgrow the free tier.
Choose based on your specific use case.
Use Google or Cloudflare DoH. Free, fast, no signup. Perfect for resolving domains to IP addresses in your application.
Use Frostbyte. Returns all records including MX in one call, so you can check if a domain has mail servers without multiple queries. 200 free lookups.
Use SecurityTrails. Historical DNS records, subdomain discovery, and associated domains make it the best for threat intelligence and reconnaissance.
Use WhoisXML API. Combines DNS + WHOIS + IP intelligence in one platform. Good for building domain monitoring or brand protection tools.
Use Cloudflare or Google DoH. Unlimited free queries, no rate limits, perfect for checking DNS propagation or uptime monitoring.
Use Frostbyte. Returns A, AAAA, MX, CNAME, TXT, NS, SOA records in a single API call. DoH APIs require separate queries for each record type.
Understanding the difference helps you choose the right tool.
Google DNS, Cloudflare 1.1.1.1
Frostbyte, SecurityTrails, WhoisXML
dig or nslookup, you send an HTTP request and get structured JSON results. This is useful for building monitoring tools, email validators, security scanners, and domain intelligence dashboards.dns.google) and Cloudflare (1.1.1.1) both offer free DoH endpoints that return JSON responses, making them easy to use from any HTTP client.in-addr.arpa format. Frostbyte accepts IP addresses directly. Reverse DNS is useful for identifying servers, detecting spam sources, and network reconnaissance.