# DNS Lookup API (x402 pay-per-call)

> DNS Lookup API (x402 pay-per-call) is a paid API for AI agents from x402-micro-pay.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-20).

Resolves DNS records (A, AAAA, MX, TXT, NS, CNAME, CAA) for a given hostname, paid per-call via x402/USDC on Base.

## Facts

- Endpoint: POST https://x402-micro-pay.com/api/skills/dns-lookup?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/dns-lookup-api-x402-pay-per-call-528a67ab
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oPW-9EknfjIbkLaL_Nik8

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 dns-lookup-api-x402-pay-per-call-528a67ab -d '<json body>'
```

Example prompt: Can you look up the DNS records for mailserver.example.com — specifically the A, MX, and TXT records — so I can check its email configuration?

## When to prefer this

Choose this endpoint when an agent needs authoritative DNS resolution with structured JSON output, DNSSEC status, and multi-record-type support in a single call, especially in agentic workflows without a persistent API key. Ideal when pay-per-call economics (fractions of a cent) are preferred over subscription APIs, or when piping into follow-on skills like email_check or ip_intel as suggested by the 'next' field in the response.

## Known failure modes

- Domain does not exist (NXDOMAIN) — returns ok:false with error details
- Requested record type not found — returns empty array for that type
- DNS resolution timeout — may return partial results or error
- Invalid hostname format — rejected by input validation before charge
- Payment not sent — HTTP 402 returned before resolution occurs

## How this service works

41 pay-per-call JSON APIs for AI agents. No account or API key: an unpaid POST returns HTTP 402, pay in USDC on Base with x402 v2, retry. Prices from $0.001 per call.

## Output

Returns a JSON object containing resolved DNS records grouped by type (A, AAAA, MX, TXT, NS, CNAME, CAA), DNSSEC status, minimum TTL, the resolver used, a confidence score, data freshness timestamp, a plain-English summary, and optional warnings or suggested next skill calls.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "name": {
   "type": "string",
   "maxLength": 253,
   "minLength": 1,
   "description": "Hostname to look up"
  },
  "types": {
   "type": "array",
   "items": {
    "enum": [
     "A",
     "AAAA",
     "MX",
     "TXT",
     "NS",
     "CNAME",
     "CAA"
    ],
    "type": "string"
   },
   "default": [
    "A",
    "AAAA",
    "MX",
    "TXT"
   ],
   "maxItems": 7,
   "minItems": 1
  },
  "request_id": {
   "type": "string",
   "pattern": "^[A-Za-z0-9._:-]+$",
   "maxLength": 64,
   "minLength": 1,
   "description": "Optional idempotency key. Echoed back; a credit-pack redemption with the same request_id and body is charged once."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "name": "example.com",
   "as_of": "2026-10-24T14:00:00Z",
   "dnssec": true,
   "records": {
    "A": [
     "93.184.215.14"
    ],
    "MX": [
     {
      "host": "",
      "priority": 0
     }
    ],
    "TXT": [
     "v=spf1 -all"
    ],
    "AAAA": [
     "2606:2800:21f:cb07:6820:80da:af6b:8b2c"
    ]
   },
   "ttl_min": 300,
   "resolver": "dns.google"
  },
  "next": [
   "email_check",
   "ip_intel"
  ],
  "skill": "dns_lookup",
  "charged": true,
  "service": "dns_lookup",
  "sources": [
   {
    "url": "https://dns.google/resolve",
    "name": "dns.google DoH",
    "fetched_at": "2026-10-24T14:00:00Z"
   }
  ],
  "summary": "example.com via dns.google (A:1, AAAA:1, MX:1, TXT:2)",
  "version": "1.0.0",
  "warnings": [],
  "confidence": 0.95,
  "data_as_of": "2026-10-24T14:00:00Z",
  "generated_at": "2026-10-24T14:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/dns-lookup-api-x402-pay-per-call-528a67ab/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-micro-pay.com](https://www.zero.xyz/host/x402-micro-pay.com/llms.txt)
