Skip to main content
Glama
badchars

osint-mcp-server

by badchars

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
NameRequiredDescriptionDefault
hostnamesYesHostnames to resolve

Implementation Reference

  • 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();
    }
  • 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));
      },
    };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/badchars/osint-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server