dns_wildcard_check
Detect wildcard DNS on a domain by resolving a random subdomain. Identifies wildcard records that can interfere with subdomain enumeration.
Instructions
Check if a domain has wildcard DNS configured by resolving a random subdomain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain to check for wildcard DNS |
Implementation Reference
- src/dns/index.ts:404-414 (handler)Core handler for dns_wildcard_check tool. Generates a random 8-byte hex subdomain and resolves it via DNS. If resolution succeeds (returns IPs), wildcard DNS is present; otherwise not.
export async function dnsWildcardCheck(domain: string): Promise<WildcardCheckResult> { const randomSub = crypto.randomBytes(8).toString("hex"); const testSubdomain = `${randomSub}.${domain}`; try { const ips = await dns.resolve4(testSubdomain); return { domain, wildcard: true, testSubdomain, resolvedIps: ips }; } catch { return { domain, wildcard: false, testSubdomain }; } } - src/dns/index.ts:62-67 (schema)Type definition (WildcardCheckResult) returned by the handler: domain, wildcard boolean, testSubdomain, and optional resolvedIps.
interface WildcardCheckResult { domain: string; wildcard: boolean; testSubdomain: string; resolvedIps?: string[]; } - src/protocol/tools.ts:77-84 (registration)Tool registration as a ToolDef with name 'dns_wildcard_check', description, Zod schema (domain as string), and execute wrapper calling dnsWildcardCheck.
const dnsWildcardCheckTool: ToolDef = { name: "dns_wildcard_check", description: "Check if a domain has wildcard DNS configured by resolving a random subdomain.", schema: { domain: z.string().describe("Domain to check for wildcard DNS"), }, execute: async (args) => json(await dnsWildcardCheck(args.domain as string)), }; - src/protocol/tools.ts:488-488 (registration)Tool is listed in the allTools array registry, making it available to the MCP protocol.
dnsWildcardCheckTool, - src/dns/index.ts:1-2 (helper)Import of crypto (for random bytes) and dns/promises (for resolve4) used by the handler.
import dns from "node:dns/promises"; import crypto from "node:crypto";