dns_list_allowed
List allowed DNS zones that bypass block lists. Start with top-level zones, then drill into subdomains by passing a parent domain.
Instructions
List allowed DNS zones (domains that bypass block lists). Returns a hierarchical tree — call with no domain to see top-level zones, then pass a domain (e.g. 'com') to drill into subdomains.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | No | Optional parent domain to list children of (e.g. 'com' to see all allowed .com domains). Omit to see top-level zones. |
Implementation Reference
- src/tools/blocking.ts:60-83 (handler)Full definition and handler for the dns_list_allowed tool. The tool is defined with name 'dns_list_allowed', accepts an optional 'domain' parameter, and its handler calls the API endpoint /api/allowed/list with the optional domain parameter (validated via validateDomain). Returns the JSON response from the Technitium DNS server.
{ definition: { name: "dns_list_allowed", description: "List allowed DNS zones (domains that bypass block lists). Returns a hierarchical tree — call with no domain to see top-level zones, then pass a domain (e.g. 'com') to drill into subdomains.", inputSchema: { type: "object", properties: { domain: { type: "string", description: "Optional parent domain to list children of (e.g. 'com' to see all allowed .com domains). Omit to see top-level zones.", }, }, }, }, readonly: true, handler: async (args) => { const params: Record<string, string> = {}; if (args.domain) params.domain = validateDomain(args.domain as string); const data = await client.callOrThrow("/api/allowed/list", params); return JSON.stringify(data, null, 2); }, }, - src/tools/blocking.ts:60-75 (schema)Input schema for dns_list_allowed. Defines a single optional string property 'domain' with description about drilling into subdomains.
{ definition: { name: "dns_list_allowed", description: "List allowed DNS zones (domains that bypass block lists). Returns a hierarchical tree — call with no domain to see top-level zones, then pass a domain (e.g. 'com') to drill into subdomains.", inputSchema: { type: "object", properties: { domain: { type: "string", description: "Optional parent domain to list children of (e.g. 'com' to see all allowed .com domains). Omit to see top-level zones.", }, }, }, }, - src/tools/index.ts:7-7 (registration)The blockingTools function is imported from './blocking.js' and registered in the getAllTools function at line 20 via spread operator.
import { blockingTools } from "./blocking.js"; - src/index.ts:47-123 (handler)The MCP server's CallToolRequestSchema handler that looks up the tool by name in toolMap and invokes tool.handler(args), which is how dns_list_allowed gets executed at runtime.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; const tool = toolMap.get(name); if (!tool) { return { content: [ { type: "text" as const, text: JSON.stringify({ error: `Unknown tool: ${name}` }) }, ], isError: true, }; } // Rate limit check const rateCheck = rateLimiter.check(name); if (!rateCheck.allowed) { audit.logSecurity("rate_limited", `Tool ${name} rate limited`); return { content: [ { type: "text" as const, text: JSON.stringify({ error: "Rate limited", retryAfterMs: rateCheck.retryAfterMs, }), }, ], isError: true, }; } const startTime = Date.now(); try { const rawResult = await tool.handler((args || {}) as Record<string, unknown>); // Sanitize the response let sanitized: string; try { const parsed = JSON.parse(rawResult); sanitized = JSON.stringify(sanitizeResponse(parsed), null, 2); } catch { sanitized = rawResult; } audit.logToolCall( name, (args || {}) as Record<string, unknown>, "success", Date.now() - startTime ); return { content: [{ type: "text" as const, text: sanitized }], }; } catch (error) { const rawMessage = error instanceof Error ? error.message : String(error); const message = sanitizeError(rawMessage); audit.logToolCall( name, (args || {}) as Record<string, unknown>, "error", Date.now() - startTime, message ); return { content: [ { type: "text" as const, text: JSON.stringify({ error: message }), }, ], isError: true, }; }