# Forest Factory DNS Consensus API

> Forest Factory DNS Consensus API is a paid API for AI agents from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-20).

Queries multiple DNS resolvers in parallel for a given hostname and record type, then returns whether they all agree on the answer (consensus state).

## Facts

- Endpoint: POST https://http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/dns/consensus?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/forest-factory-dns-consensus-api-3102c83d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HwVWb_Ojo4YtYPAzseyLs

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 forest-factory-dns-consensus-api-3102c83d -d '<json body>'
```

Example prompt: Can you check whether the A record for example.com is consistent across all DNS resolvers — I want to know if they're all in agreement?

## When to prefer this

Choose this endpoint when you need to verify DNS consistency across multiple resolvers simultaneously rather than querying a single resolver. It is ideal for detecting propagation lag, split-horizon DNS, or potential DNS hijacking. Prefer it over a simple DNS lookup when consensus or agreement across the resolver network matters for your use case.

## Known failure modes

- Invalid hostname format returns a 400 validation error
- Unsupported record type outside the allowed enum returns a 400 error
- All resolvers fail to respond results in failed_resolvers count equal to resolver_count
- Payment not attached or invalid returns HTTP 402 with x402 PAYMENT-REQUIRED challenge
- Network timeouts may result in partial resolver responses skewing consensus

## How this service works

Machine-readable contract for active Forest paid capabilities. Unsigned paid calls return HTTP 402 with a PAYMENT-REQUIRED x402 challenge.

## Output

Returns a JSON object indicating the consensus state (e.g. 'agreement' or 'disagreement') across multiple DNS resolvers for the queried hostname and record type. Includes the list of resolvers queried, individual answer sets, count of successful and failed resolvers, cache hit/miss status, the DNS provider used (e.g. Cloudflare DoH), the timestamp of the check, and the duration in milliseconds.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "hostname": {
   "type": "string",
   "pattern": "^[a-zA-Z0-9.-]+$",
   "maxLength": 253,
   "description": "Public hostname value used to scope this lookup."
  },
  "record_type": {
   "enum": [
    "A",
    "AAAA",
    "CNAME",
    "MX",
    "NS",
    "TXT"
   ],
   "description": "Public record type value used to scope this lookup."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "state": "agreement",
   "hostname": "example",
   "resolvers": [],
   "answer_sets": [],
   "record_type": "example",
   "resolver_count": 1,
   "failed_resolvers": 0,
   "successful_resolvers": 0
  },
  "meta": {
   "cache": "miss",
   "provider": "cloudflare-doh",
   "checked_at": "2026-01-01T00:00:00.000Z",
   "duration_ms": 0
  },
  "version": "1",
  "capability": "dns.consensus"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/forest-factory-dns-consensus-api-3102c83d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run](https://www.zero.xyz/host/http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/llms.txt)
