COMPARISON GUIDE

Free DNS Lookup API Comparison 2026

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.

Last updated: March 2026 | 5 providers compared

DNS Record Types You Can Query

Every DNS API supports different record types. Here are the most common ones used in application development:

AIPv4 Address
AAAAIPv6 Address
MXMail Servers
CNAMEAliases
TXTSPF/DKIM/DMARC
NSNameservers
SOAStart of Authority
PTRReverse DNS
SRVService Records

Quick Comparison

Feature 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

Provider Breakdown

Detailed analysis of each DNS API with strengths and weaknesses.

Google Public DNS

DNS-over-HTTPS by Google. Free, fast, reliable.
Free unlimited DoH protocol No signup
  • Completely free, no limits
  • No API key needed
  • Ultra-fast global network
  • DNSSEC validation
  • One record type per query
  • Raw DNS wire format
  • No historical data
  • No WHOIS or enrichment

Cloudflare DNS

1.1.1.1 DNS-over-HTTPS. Privacy-focused, fastest resolver.
Free unlimited DoH protocol Fastest resolver
  • Fastest public DNS resolver
  • Privacy-first (purges logs in 24h)
  • No signup required
  • Supports DNS-over-TLS too
  • One record type per query
  • No bulk or historical lookups
  • No domain intelligence
  • Raw DNS response format

SecurityTrails

DNS intelligence platform. Historical records, subdomains, WHOIS.
50 free/mo Historical DNS OSINT grade
  • Historical DNS records
  • Subdomain enumeration
  • Associated domains
  • Rich WHOIS data
  • Only 50 free queries/month
  • Expensive paid plans ($50+/mo)
  • Requires email signup
  • Rate limited on free tier

WhoisXML API

DNS + WHOIS + IP intelligence. Enterprise-grade data.
500 free/mo WHOIS included Enterprise grade
  • 500 free queries per month
  • DNS + WHOIS in one platform
  • IP geolocation add-on
  • Supports JSON and XML
  • Complex pricing tiers
  • Requires email signup
  • Paid plans start at $19/mo
  • Rate limit 20 req/sec

Frostbyte DNS OUR PICK

All DNS records in one call. No signup forms. Instant API key.
200 free credits All records in 1 call No signup form
  • All record types in one request
  • Instant API key, no email
  • Clean JSON response
  • Pay-as-you-go ($1/200 credits)
  • 200 free credits (not unlimited)
  • No historical DNS data
  • No subdomain enumeration
  • Newer service

Try It Live

Enter any domain to see all DNS records. Uses the Frostbyte DNS API - no API key required for this demo.


  

Code Examples

Copy-paste examples for each provider. All return JSON.

Google Public DNS (DoH)

cURL
JavaScript
Python
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'])

Cloudflare DNS (DoH)

cURL
JavaScript
Python
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'])

Frostbyte DNS (All Records at Once)

cURL
JavaScript
Python
Go
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 response
package 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))
}

Get Your Free API Key

200 free credits. All DNS record types in one call. No signup forms.

Get API Key → Try DNS Tool

Pricing Comparison

What each DNS API costs when you outgrow the free tier.

Google DNS
$0
Unlimited queries
No paid tier needed
Cloudflare
$0
Unlimited queries
No paid tier needed
SecurityTrails
$50/mo
50K queries/mo
Historical + subdomains
WhoisXML API
$19/mo
5K queries/mo
DNS + WHOIS bundle
Frostbyte
$1/200 credits
Pay-as-you-go
No monthly commitment

Which DNS API Should You Use?

Choose based on your specific use case.

Simple A/AAAA Resolution

Use Google or Cloudflare DoH. Free, fast, no signup. Perfect for resolving domains to IP addresses in your application.

Email Validation (MX Records)

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.

Security Research / OSINT

Use SecurityTrails. Historical DNS records, subdomain discovery, and associated domains make it the best for threat intelligence and reconnaissance.

Domain Intelligence Dashboard

Use WhoisXML API. Combines DNS + WHOIS + IP intelligence in one platform. Good for building domain monitoring or brand protection tools.

Monitoring / Health Checks

Use Cloudflare or Google DoH. Unlimited free queries, no rate limits, perfect for checking DNS propagation or uptime monitoring.

All Records in One Call

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.

DNS-over-HTTPS vs DNS Lookup APIs

Understanding the difference helps you choose the right tool.

DNS-over-HTTPS (DoH)

Google DNS, Cloudflare 1.1.1.1

  • Resolves one record type per query
  • Returns raw DNS wire-format data
  • Free, unlimited, no auth
  • Standard DNS protocol over HTTPS
  • Best for: basic resolution, privacy

DNS Lookup APIs

Frostbyte, SecurityTrails, WhoisXML

  • Returns multiple record types at once
  • Clean, structured JSON responses
  • Credit-based or subscription pricing
  • Often includes enrichment (WHOIS, history)
  • Best for: apps, dashboards, intelligence

Frequently Asked Questions

What is a DNS lookup API?
A DNS lookup API lets you programmatically resolve domain names to their associated DNS records (A, AAAA, MX, CNAME, TXT, NS, SOA, PTR) via HTTP requests. Instead of using command-line tools like 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.
What is the best free DNS lookup API?
For simple A/AAAA resolution, Google Public DNS and Cloudflare DNS-over-HTTPS are free with no API key required. For richer data including MX, TXT, NS, SOA records in a single call, Frostbyte DNS API returns all record types at once with 200 free credits and no signup form. SecurityTrails offers the most comprehensive data (including historical records) but has a very limited free tier (50 queries/month).
How do I check MX records for email validation?
Query the MX records for the email domain via a DNS API. If the domain returns MX records, it can receive email. No MX records usually means the domain doesn't handle email. You can also check TXT records for SPF and DMARC policies to verify email authentication. This technique validates email domains without sending actual test emails.
What is DNS-over-HTTPS (DoH)?
DNS-over-HTTPS (DoH) sends DNS queries over encrypted HTTPS connections instead of plain UDP port 53. This prevents ISPs and network operators from seeing or modifying your DNS queries. Google (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.
Can I do reverse DNS lookups via API?
Yes. Reverse DNS (rDNS or PTR lookup) maps an IP address back to a hostname. All providers in this comparison support reverse lookups. For Google/Cloudflare DoH, query the PTR record type with the reversed IP in in-addr.arpa format. Frostbyte accepts IP addresses directly. Reverse DNS is useful for identifying servers, detecting spam sources, and network reconnaissance.
What DNS record types are most important?
A/AAAA records map domains to IP addresses. MX records identify mail servers (essential for email validation). TXT records contain SPF, DKIM, and DMARC email authentication policies. CNAME records show aliases (common with CDNs). NS records reveal which DNS provider a domain uses. SOA records show the primary nameserver and refresh intervals.
How many DNS queries can I make for free?
Google and Cloudflare DoH are effectively unlimited. Frostbyte offers 200 free credits (1 per lookup). SecurityTrails gives 50 free queries per month. WhoisXML API provides 500 free queries per month. For high-volume lookups (millions per day), Google and Cloudflare DoH are the clear choice. For rich DNS intelligence, the paid APIs are more cost-effective than building your own resolver.