DNS lookup

$0.002 per call · USDC via x402 · POST /api/dns-lookup

Resolve any DNS record type for a host: A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV, PTR. Send POST /api/dns-lookup with the required field host and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with host, type, records, count and queriedAt.

Returns the records plus a count. Built on Node's native resolver - no external API.

Category: Network & domains · Tags: dns lookup network diagnostic a aaaa mx txt

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
hoststringyesHostname to resolve Also accepted as hostname, domain, site, server.
typestringnoRecord type: A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV (default A)

Example request

curl -i -X POST https://agent402.tools/api/dns-lookup \
  -H "Content-Type: application/json" \
  -d '{"host":"google.com","type":"MX"}'

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

Example response

{
  "host": "google.com",
  "type": "MX",
  "records": [
    {
      "priority": 10,
      "exchange": "smtp.google.com"
    }
  ],
  "count": 1,
  "queriedAt": "2026-06-19T20:00:00.000Z"
}
FieldTypeAlways presentIn the example
hoststringyesgoogle.com
typestringyesMX
recordsarray of objectsyes1 item in the example
countnumberyes1
queriedAtstringyes2026-06-19T20:00:00.000Z

From an MCP client

catalog.call {
  "slug": "dns-lookup",
  "params": {
    "host": "google.com",
    "type": "MX"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for dns-lookup; 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-lookup", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "host": "google.com",
    "type": "MX"
  }),
});

Part of these workflows

DNS lookup is one step in these 10 skill packs, each sold as a single call:

Related tools

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…

ASN + IP geolocation

$0.001 · POST /api/asn-info

Look up the Autonomous System (ASN), prefix, country, registry, and allocation date for an IPv4 address - or for a hostn…

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.001 · GET /api/dns

Live DNS lookup for a domain: returns name, type and records[]. Supported record types: A, AAAA (addresses as strings), …

Email deliverability check

$0.002 · POST /api/email-deliverability

End-to-end email-auth report for a domain: SPF + DMARC + DKIM (probes common selectors automatically) + MX records + sco…