JSON API for DNS lookups over DoH (RFC 8484). CORS enabled for all origins.
GET /api/lookup
Returns JSON. All responses include the requested host and type so the payload is self-contained.
hostrequiredexample.com). Must be a valid DNS name (labels, length, character set).typeoptional, default Aprovideroptional, default cloudflarecloudflare, google, quad9, mullvad, or controld. Resolution uses RFC 8484 DoH or DoT wire format depending on transport.transportoptional, default dohdoh (DNS over HTTPS) or dot (DNS over TLS). DoT is only available for cloudflare, google, and quad9.{
"ok": true,
"host": "example.com",
"type": "A",
"records": ["93.184.216.34"],
"ttls": [3600],
"authority": null,
"additional": null
}records and ttls are parallel arrays (same order). authority and additional are present when the DNS response included those sections; otherwise null.
ok: false or 400){ "ok": false, "host": "example.com", "type": "A", "error": "NXDOMAIN", "authority": { "records": ["..."], "ttls": [900] }, "additional": null }For DNS errors (e.g. NXDOMAIN), authority and additional may be included when the resolver returned them. For invalid input, the API returns 400 with e.g. { "ok": false, "error": "invalid_host" }.
Limits are applied per client (by IP or X-Forwarded-For/ X-Real-IP when behind a proxy). Default: 60 requests per minute. When exceeded, the API returns 429 with { "ok": false, "error": "rate_limit_exceeded" } and a Retry-After header (seconds).
Successful responses include X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (Unix timestamp).
# Basic A record curl "https://your-domain.com/api/lookup?host=example.com&type=A" # With provider and transport curl "https://your-domain.com/api/lookup?host=example.com&type=A&provider=google" curl "https://your-domain.com/api/lookup?host=example.com&type=A&provider=cloudflare&transport=dot" # MX records curl "https://your-domain.com/api/lookup?host=example.com&type=MX"