shodan_dns_resolve
Resolve hostnames to IP addresses using Shodan's DNS resolver for reconnaissance and attack surface mapping.
Instructions
Resolve hostnames to IPs using Shodan's DNS resolver. Requires SHODAN_API_KEY.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hostnames | Yes | Hostnames to resolve |
Implementation Reference
- src/shodan/index.ts:126-132 (handler)The handler function that executes the Shodan DNS resolution.
export async function shodanDnsResolve(hostnames: string[], apiKey: string): Promise<Record<string, string | null>> { await limiter.acquire(); const csv = hostnames.join(","); const res = await fetch(`https://api.shodan.io/dns/resolve?hostnames=${encodeURIComponent(csv)}&key=${apiKey}`); if (!res.ok) throw new Error(`Shodan DNS resolve failed: ${res.status}`); return res.json(); } - src/protocol/tools.ts:153-163 (registration)Tool definition and registration for 'shodan_dns_resolve'.
const shodanDnsResolveTool: ToolDef = { name: "shodan_dns_resolve", description: "Resolve hostnames to IPs using Shodan's DNS resolver. Requires SHODAN_API_KEY.", schema: { hostnames: z.array(z.string()).describe("Hostnames to resolve"), }, execute: async (args, ctx) => { const key = requireApiKey(ctx.config.shodanApiKey, "Shodan", "SHODAN_API_KEY"); return json(await shodanDnsResolve(args.hostnames as string[], key)); }, };