DNS lookup
POST /api/dns-lookupResolve 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.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
host | string | yes | Hostname to resolve Also accepted as hostname, domain, site, server. |
type | string | no | Record 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"
}
| Field | Type | Always present | In the example |
|---|---|---|---|
host | string | yes | google.com |
type | string | yes | MX |
records | array of objects | yes | 1 item in the example |
count | number | yes | 1 |
queriedAt | string | yes | 2026-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
hostis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/dns-lookup returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
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:
- Security audit - Enumerate a domain's external attack surface in one workflow: certs, DNS posture, email auth, HTTP security headers, and tech stack.
- Email deliverability - Diagnose why a domain's email lands in spam: SPF posture, DMARC policy, DKIM key strength, MX targets, and a composite 0–100 score.
- DNS & network ops - End-to-end DNS health check: records, multi-resolver propagation, WHOIS, ASN, robots.txt, and reachability.
- Fraud signals - Is this domain trustworthy, or is it a phishing site / typosquat / scam? Pull the reputation signals an analyst checks before clicking anything: domain age, cert issuance history, hosting reputation, DNS topology, tech-stack fingerprint, and page-content red flags. Different from a security audit - this is about whether the domain is what it claims to be.
- Site status snapshot - The 'is this site healthy, addressable, and crawlable - right now?' workflow. DNS resolution → HTTP reachability → security headers → TLS certificate expiry → robots policy. Five tools, one structured status payload an operator (or an uptime bot, or a pre-flight check before an extract/crawl) can act on.
- Domain intel - Full domain security and SEO intelligence in one call: WHOIS, DNS, TLS cert, HTTP headers, tech stack, robots policy, and certificate transparency.
- SSL audit - TLS/SSL security posture check: live certificate inspection, HTTP security headers, and CAA DNS records.
- Brand protection - Is this domain legitimate? WHOIS age, DNS resolution, scam/phishing search results, and HTTP headers for a quick trust assessment.
- Contact verification - Verify an email address is deliverable - syntax validation plus MX record check on the domain.
- Domain age and legitimacy - How old and legit is this domain? WHOIS registration, DNS resolution, and TLS certificate in one pass.
Related tools
DNS propagation check
POST /api/dns-propagationResolve the same DNS record against 4 public resolvers (Google, Cloudflare, Quad9, OpenDNS) in parallel; surface diverge…
ASN + IP geolocation
POST /api/asn-infoLook up the Autonomous System (ASN), prefix, country, registry, and allocation date for an IPv4 address - or for a hostn…
DKIM key lookup
POST /api/dkim-lookupFetch and parse a DKIM public-key record at <selector>._domainkey.<domain> (RFC 6376). Returns the parsed key params (al…
DMARC check
POST /api/dmarc-checkFetch and validate a domain's DMARC policy at _dmarc.<domain> (RFC 7489). Surfaces the enforcement policy (none/quaranti…
DNS lookup
GET /api/dnsLive DNS lookup for a domain: returns name, type and records[]. Supported record types: A, AAAA (addresses as strings), …
Email deliverability check
POST /api/email-deliverabilityEnd-to-end email-auth report for a domain: SPF + DMARC + DKIM (probes common selectors automatically) + MX records + sco…