# DNS Lookup via Cloudflare DoH

> DNS Lookup via Cloudflare DoH is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Queries Cloudflare 1.1.1.1 DNS-over-HTTPS to resolve any DNS record type (A, AAAA, MX, TXT, NS, CNAME, SOA, PTR, SRV, CAA, DNSKEY, DS, TLSA, HTTPS, SVCB) for a given domain, returning grouped and flat result shapes with TTLs.

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/dns-lookup
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-1e7c6465
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_X5YqwtqGPFqmOxvUsZTVo

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-deployer-x402-deployer-workers-dev-1e7c6465 -d '<json body>'
```

Example prompt: Can you look up all the DNS records for example.com — I want to see the A, MX, TXT, and NS records, especially to check the SPF and DMARC policies and which mail servers are configured?

## When to prefer this

Use this endpoint when you need programmatic DNS resolution with support for a wide range of record types beyond basic A/AAAA, especially for email deliverability checks (MX, SPF/DMARC TXT), security audits (CAA, DNSSEC, TLSA), or infrastructure inspection — backed by Cloudflare 1.1.1.1 for reliability and speed. Prefer over raw dig/nslookup when you need structured JSON output with TTLs in both grouped and flat formats.

## Known failure modes

- Domain does not exist (NXDOMAIN) — returns empty result or error
- Invalid domain name format — validation error
- Requested record type not found for domain — empty records for that type
- Cloudflare DoH upstream timeout or unreachable — 502/504 error
- Payment not accepted or insufficient — 402 payment required

## How this service works

DNS lookup / DNS resolver / dig replacement / nslookup API / DoH proxy / authoritative-record fetch / MX checker / SPF + DMARC TXT inspector / CAA + DNSSEC inspector / nameserver finder / CDN-routing detector. Queries Cloudflare 1.1.1.1 DNS-over-HTTPS for any subset of A, AAAA, MX, TXT, NS, CNAME, SOA, PTR, SRV, CAA, DNSKEY, DS, TLSA, HTTPS, SVCB records and returns both grouped (per type, with TTL) and flat shapes for easy consumption.

## Output

Returns DNS records grouped by type (each group containing the record values and TTL) plus a flat list of all records for easy consumption. Covers any requested subset of A, AAAA, MX, TXT, NS, CNAME, SOA, PTR, SRV, CAA, DNSKEY, DS, TLSA, HTTPS, and SVCB record types.

## Example request

```json
{
 "input": {
  "body": {
   "types": [
    "A",
    "MX",
    "TXT",
    "NS"
   ],
   "domain": "example.com"
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "type": "string",
     "enum": [
      "POST"
     ]
    },
    "bodyType": {
     "type": "string",
     "enum": [
      "json",
      "form-data",
      "text"
     ]
    },
    "body": {
     "properties": {
      "domain": {
       "type": "string",
       "description": "Domain or hostname to resolve (e.g. 'example.com', 'mail.example.com'). Sent as-is, not stripped to apex."
      },
      "types": {
       "type": "array",
       "items": {
        "type": "string"
       },
       "description": "Optional record types to query. Default: ['A', 'AAAA', 'MX', 'TXT', 'NS']. Any of A, AAAA, MX, TXT, NS, CNAME, SOA, PTR, SRV, CAA, DNSKEY, DS, TLSA, HTTPS, SVCB."
      }
     },
     "required": [
      "domain"
     ]
    }
   },
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "domain": {
       "type": "string"
      },
      "total_records": {
       "type": "integer"
      },
      "records": {
       "type": "object",
       "properties": {
        "A": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "data": {
            "type": "string"
           },
           "ttl": {
            "type": "integer"
           }
          }
         }
        },
        "MX": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "data": {
            "type": "string"
           },
           "ttl": {
            "type": "integer"
           }
          }
         }
        },
        "TXT": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "data": {
            "type": "string"
           },
           "ttl": {
            "type": "integer"
           }
          }
         }
        }
       }
      },
      "flat": {
       "type": "object",
       "properties": {
        "a": {
         "type": "array",
         "items": {
          "type": "string"
         }
        },
        "mx": {
         "type": "array",
        
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-1e7c6465/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
