# agent402.tools DNS Lookup

> agent402.tools DNS Lookup is a paid API for AI agents from agent402.tools, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Resolves any DNS record type (A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV, PTR) for a given hostname and returns the records with a count

## Facts

- Endpoint: POST https://agent402.tools/api/dns-lookup
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-dns-lookup-b95fa390
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UlyMotXw6rOVCONIdBRsZ

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 agent402-tools-dns-lookup-b95fa390 -d '<json body>'
```

Example prompt: Can you look up the MX records for example.com so I can see which mail servers handle its email?

## When to prefer this

Use this endpoint when you need programmatic DNS resolution across any standard record type without relying on an external third-party DNS API — it uses Node's native resolver, making it lightweight and dependency-free. Prefer this over shell-based dig/nslookup calls when operating in an agent context that supports x402 micropayments.

## Known failure modes

- Host not found / NXDOMAIN — domain does not exist
- No records of the requested type exist for the host
- Invalid record type specified — falls back to A or returns error
- Network timeout if DNS resolution takes too long
- Malformed hostname input

## How this service works

Resolve any DNS record type for a host: A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV, PTR. Returns the records plus a count. Built on Node's native resolver - no external API.

## Output

Returns an array of DNS records of the requested type for the given hostname, along with a count of how many records were found. Record format varies by type (e.g. IP addresses for A/AAAA, hostnames and priorities for MX, strings for TXT).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "host": {
   "type": "string",
   "description": "Hostname to resolve"
  },
  "type": {
   "type": "string",
   "description": "Record type: A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV (default A)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "host": "google.com",
  "type": "MX",
  "count": 1,
  "records": [
   {
    "exchange": "smtp.google.com",
    "priority": 10
   }
  ],
  "queriedAt": "2026-06-19T20:00:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-dns-lookup-b95fa390/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
