DNS Lookup
free/v1/dns/lookupPerforms comprehensive DNS lookups via DNS-over-HTTPS (RFC 8484) using Cloudflare's global anycast infrastructure. Returns structured JSON with TTL, priority values, and DNSSEC validation status across 22 record types — no output parsing required. Use type=ALL to query all record types in a single call.
What It Does
Queries DNS records through Cloudflare's DNS-over-HTTPS service, supporting 22 record types: A, AAAA, CNAME, MX, NS, TXT, SOA, SRV, CAA, PTR, DNSKEY, DS, TLSA, NAPTR, SSHFP, HTTPS, SVCB, DNAME, LOC, URI, CERT, and SMIMEA. Use type=ALL to query all 22 types in parallel and get a complete DNS profile in one request. Follows CNAME chains automatically and includes DNSSEC authentication verification and resolver metadata in every response.
Why It's Useful
Unlike command-line tools like dig or nslookup, EdgeDNS returns structured JSON with resolver metadata — no parsing required. Integrates directly into CI/CD pipelines, monitoring dashboards, and security automation workflows. Essential for domain verification, email deliverability checks, infrastructure audits, and security assessments at scale.
Use Cases
Email Deliverability Pre-Check
Before sending campaigns, verify that recipient domains have properly configured MX records pointing to active mail servers and are not configured with Null MX (RFC 7505).
Reduce bounce rates by 15-20% by pre-validating recipient domains and detecting domains that explicitly reject email.
Domain Migration Monitoring
During domain migrations, continuously query multiple record types to verify changes propagated correctly.
Catch misconfigurations before they impact users, reducing migration-related downtime.
Security Configuration Audit
Automated scanning of TLSA (DANE), DNSKEY, DS, and CAA records across organization domains to verify DNSSEC chains, certificate pinning, and CA authorization policies.
Maintain security policy compliance across hundreds of domains with automated checks covering the full DNS security stack.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Required | The domain name to query (e.g., example.com)Example: example.com |
type | string | Optional | DNS record type to query. Use ALL to query all 22 types at once. Defaults to A if not specified.Example: AOptions: ALL, A, AAAA, CAA, CERT, CNAME, DNAME, DNSKEY, DS, HTTPS, LOC, MX, NAPTR, NS, PTR, SMIMEA, SOA, SRV, SSHFP, SVCB, TLSA, TXT, URI |
Response Fields
| Field | Type | Description |
|---|---|---|
domain | string | The queried domain |
record_type | string | The DNS record type queried |
records | array | Array of DNS records with type, value, TTL, priority, weight (SRV), and port (SRV) |
authenticated | boolean | DNSSEC validation status (AD flag) |
resolver | string | The DNS resolver used for the query |
duration_ms | number | Time taken for DNS query in milliseconds |
Code Examples
curl "https://api.edgedns.dev/v1/dns/lookup" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "domain=example.com"const response = await fetch(
'https://api.edgedns.dev/v1/dns/lookup?domain=example.com',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(data);import requests
response = requests.get(
'https://api.edgedns.dev/v1/dns/lookup',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'domain': 'example.com'
}
)
data = response.json()
print(data)Read the full DNS Lookup guide
Why it matters, real-world use cases, parameters, response fields, and how to call it from Claude, ChatGPT, or Gemini via MCP.
Read the guide →Related Endpoints
External References
Learn more about the standards and protocols behind this endpoint.