FETCHX402

LIVE

x402 DNS API

DNS Explorer

agent dns lookup. Pay-per-request DNS for agents. Not a fetch wrapper.

LIVE $0.005 USDC GET /v1/tools/dns

When to use

Resolve public DNS records (A, AAAA, MX, TXT, CNAME, NS, SOA) for a domain. Use when you need live DNS data and must not guess from memory or training data.

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/v1/tools/dns?domain=example.com&type=A

Full URL: https://api.fetchx402.com/v1/tools/dns?domain=example.com&type=A

Request

GET /v1/tools/dns · x402 V2 · USDC on Base · $0.005 USDC

x402 V2 curl

Expect HTTP 402 and a PAYMENT-REQUIRED header until you retry with PAYMENT-SIGNATURE.

curl -i -H "Accept: application/json" "https://api.fetchx402.com/v1/tools/dns?domain=example.com&type=A"

Cursor mcp.json

Intended config for @fetchx402/mcp. This is not npm @x402/fetch (a payment fetch wrapper).

{
  "mcpServers": {
    "fetchx402": {
      "args": [
        "-y",
        "@fetchx402/mcp"
      ],
      "command": "npx",
      "env": {
        "X402_PRIVATE_KEY": "0xYOUR_SPENDING_KEY"
      }
    }
  }
}

Query parameters

Name Type Required Description
domain string required Public fully-qualified domain name to resolve, such as example.com. IPs, localhost, and internal/mDNS names are rejected.
type string optional · A, AAAA, MX, TXT, CNAME, NS, SOA · default A DNS record type. A = IPv4 addresses, AAAA = IPv6, MX = mail exchangers, TXT = text (SPF/DKIM), CNAME = alias, NS = nameservers, SOA = start of authority. Defaults to A if omitted.

Success fields

Field Type Description
domain string Normalized FQDN that was queried
type string DNS record type that was queried
rcode string Resolver response code, such as NOERROR
resolver string Public recursive resolver that answered
ttl integer | null Lowest TTL among answers, in seconds
records array Answer records. Object shape depends on type (see record shapes)

Record shapes

Type records[] fields
A address (string) — IPv4 address
AAAA address (string) — IPv6 address
MX priority (integer), host (string)
TXT text (string)
CNAME host (string)
NS host (string)
SOA mname, rname (string); serial, refresh, retry, expire, minimum (integer)

Example

Frozen fixture. Not a live lookup.

{
  "domain": "example.com",
  "rcode": "NOERROR",
  "records": [
    {
      "address": "104.20.23.154"
    }
  ],
  "resolver": "1.1.1.1",
  "ttl": 20,
  "type": "A"
}

Payment

Unpaid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. Retry the same URL with PAYMENT-SIGNATURE. Settlement completes before the tool runs. Full handshake and shared payment errors: Payments.

Errors

HTTP Code When
400 invalid_domain Domain is missing, malformed, an IP address, or a blocked/internal name
400 invalid_type type must be one of A, AAAA, MX, TXT, CNAME, NS, SOA
402 payment_required Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header
404 nxdomain The domain name does not exist
503 overloaded Tool concurrency cap reached; retry shortly
503 upstream_unavailable Public DNS resolvers were unreachable
504 dns_timeout DNS resolution timed out
409 payment_in_progress The same authorization nonce is already being settled; retry shortly
429 rate_limited Too many requests from this client
503 settlement_uncertain Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE
503 facilitator_unavailable Payment facilitator unavailable
503 facilitator_misconfigured Payment facilitator is not configured
503 facilitator_unauthorized Payment facilitator rejected credentials
503 ledger_unavailable Payment ledger unavailable
503 payment_unavailable Payment processing unavailable

Guarantees

  • Settlement finishes before the tool executes. Uncertain settlement fails closed (HTTP 503).
  • Lookups run on our nodes — no third-party data API wrappers.
  • Localhost, IP literals, and metadata hostnames are rejected.
  • Execution is timeout-bounded and concurrency-capped.