Skip to main content

DNS Lookup

free
GET/v1/dns/lookup

Performs 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 Marketing Team

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.

DevOps Engineer

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 Engineer

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

NameTypeRequiredDescription
domainstringRequiredThe domain name to query (e.g., example.com)Example: example.com
typestringOptionalDNS 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

FieldTypeDescription
domainstringThe queried domain
record_typestringThe DNS record type queried
recordsarrayArray of DNS records with type, value, TTL, priority, weight (SRV), and port (SRV)
authenticatedbooleanDNSSEC validation status (AD flag)
resolverstringThe DNS resolver used for the query
duration_msnumberTime taken for DNS query in milliseconds

Code Examples

cURL
curl "https://api.edgedns.dev/v1/dns/lookup" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "domain=example.com"
JavaScript
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);
Python
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.

Try This Endpoint

Test the DNS Lookup endpoint live in the playground.