DNS lookup

$0.001 per call · USDC via x402 · GET /api/dns · Cached 5m

Live DNS lookup for a domain: returns name, type and records[]. Send GET /api/dns with the required field name and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with name, type and records.

Supported record types: A, AAAA (addresses as strings), MX ({exchange, priority} objects), TXT (each record an array of its strings), NS and CNAME (hostnames). For SPF, DMARC or a full mail-security read use spf-check, dmarc-check or email-deliverability.

Category: Network & domains · Tags: dns domains networking

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
namestringyesDomain name, e.g. example.com
typestringnoRecord type (default A)

Example request

curl -i "https://agent402.tools/api/dns?name=example.com&type=A"

Without payment this returns HTTP 402 Payment Required with the exact price for dns; any x402 v2 or MPP client pays it and retries.

Example response

{
  "name": "example.com",
  "type": "A",
  "records": [
    "93.184.215.14"
  ]
}
FieldTypeAlways presentIn the example
namestringyesexample.com
typestringyesA
recordsarray of stringyes1 item in the example

From an MCP client

catalog.call {
  "slug": "dns",
  "params": {
    "name": "example.com",
    "type": "A"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for dns; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/dns?name=example.com&type=A");

Related tools

DKIM key lookup

$0.002 · POST /api/dkim-lookup

Fetch and parse a DKIM public-key record at <selector>._domainkey.<domain> (RFC 6376). Returns the parsed key params (al…

DMARC check

$0.001 · POST /api/dmarc-check

Fetch and validate a domain's DMARC policy at _dmarc.<domain> (RFC 7489). Surfaces the enforcement policy (none/quaranti…

DNS lookup

$0.002 · POST /api/dns-lookup

Resolve any DNS record type for a host: A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV, PTR. Returns the records plus a coun…

DNS propagation check

$0.002 · POST /api/dns-propagation

Resolve the same DNS record against 4 public resolvers (Google, Cloudflare, Quad9, OpenDNS) in parallel; surface diverge…

SPF check

$0.001 · POST /api/spf-check

Fetch and validate a domain's SPF record (RFC 7208). Parses mechanisms (ip4/ip6/include/a/mx/all), counts DNS lookups ag…

A2A Agent Card fetch

$0.005 · POST /api/a2a-card-fetch

Discover and fetch a site's A2A (Agent2Agent protocol) Agent Card - tries /.well-known/agent-card.json then /.well-known…