recon.dns
Resolve DNS records for domains to identify infrastructure details during security reconnaissance and vulnerability testing.
Instructions
Resolve DNS records for a domain or subdomain
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain to resolve | |
| recordType | No | DNS record type (A, AAAA, CNAME, MX, TXT) | A |
Implementation Reference
- src/tools/recon.ts:183-204 (handler)The handler function for the 'recon.dns' tool. It verifies the 'dig' command is available, executes 'dig +short <domain> <recordType>' to resolve DNS records, parses the stdout into a list of records, and returns a formatted ToolResult with success status, records, and raw output.async ({ domain, recordType = 'A' }: any): Promise<ToolResult> => { try { const exists = await checkCommandExists('dig'); if (!exists) { return formatToolResult(false, null, 'dig command not found'); } const result = await runCommand('dig', ['+short', domain, recordType]); const records = result.stdout .split('\n') .filter((s) => s.trim().length > 0); return formatToolResult(true, { domain, recordType, records, raw: result.stdout, }); } catch (error: any) { return formatToolResult(false, null, error.message); } }
- src/tools/recon.ts:171-181 (schema)Input schema definition for the 'recon.dns' tool, specifying required 'domain' parameter and optional 'recordType' with default 'A'.type: 'object', properties: { domain: { type: 'string', description: 'Domain to resolve' }, recordType: { type: 'string', description: 'DNS record type (A, AAAA, CNAME, MX, TXT)', default: 'A', }, }, required: ['domain'], },
- src/tools/recon.ts:167-205 (registration)Specific registration of the 'recon.dns' tool on the MCP server, including name, description, input schema, and inline handler function.'recon.dns', { description: 'Resolve DNS records for a domain or subdomain', inputSchema: { type: 'object', properties: { domain: { type: 'string', description: 'Domain to resolve' }, recordType: { type: 'string', description: 'DNS record type (A, AAAA, CNAME, MX, TXT)', default: 'A', }, }, required: ['domain'], }, }, async ({ domain, recordType = 'A' }: any): Promise<ToolResult> => { try { const exists = await checkCommandExists('dig'); if (!exists) { return formatToolResult(false, null, 'dig command not found'); } const result = await runCommand('dig', ['+short', domain, recordType]); const records = result.stdout .split('\n') .filter((s) => s.trim().length > 0); return formatToolResult(true, { domain, recordType, records, raw: result.stdout, }); } catch (error: any) { return formatToolResult(false, null, error.message); } } );
- src/index.ts:35-35 (registration)Top-level registration call that invokes registerReconTools(server), which registers the 'recon.dns' tool along with other reconnaissance tools.registerReconTools(server);