dns_enable_zone
Re-enable a disabled DNS zone on your Technitium DNS server by specifying the zone domain name.
Instructions
Enable a disabled DNS zone.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zone | Yes | Zone domain name to enable |
Implementation Reference
- src/tools/zones.ts:139-147 (handler)The handler function for the dns_enable_zone tool. Validates the zone domain, calls the API endpoint /api/zones/enable, and returns a success response with the enabled zone name.
handler: async (args) => { const zone = validateDomain(args.zone as string); const data = await client.callOrThrow("/api/zones/enable", { zone }); return JSON.stringify( { success: true, enabled: zone, ...data }, null, 2 ); }, - src/tools/zones.ts:124-137 (schema)The schema/definition for dns_enable_zone. Includes name 'dns_enable_zone', description, and input schema requiring a 'zone' string parameter.
definition: { name: "dns_enable_zone", description: "Enable a disabled DNS zone.", inputSchema: { type: "object", properties: { zone: { type: "string", description: "Zone domain name to enable", }, }, required: ["zone"], }, }, - src/tools/index.ts:14-27 (registration)The getAllTools function that aggregates all tool lists including zoneTools (which contains dns_enable_zone) and registers them together.
export function getAllTools(client: TechnitiumClient): ToolEntry[] { return [ ...dashboardTools(client), ...dnsClientTools(client), ...zoneTools(client), ...recordTools(client), ...blockingTools(client), ...cacheTools(client), ...settingsTools(client), ...logTools(client), ...appTools(client), ...dnssecTools(client), ]; } - src/index.ts:21-35 (registration)The main server setup that calls getAllTools and builds a toolMap used to dispatch tool calls. This is where dns_enable_zone gets registered into the MCP server.
const allTools = getAllTools(client); // Filter out write tools in readonly mode const tools = config.readonly ? allTools.filter((t) => t.readonly) : allTools; if (config.readonly) { audit.logSecurity( "readonly_mode", `Exposing ${tools.length} of ${allTools.length} tools (write tools hidden)` ); } const toolMap = new Map(tools.map((t) => [t.definition.name, t])); - src/validate.ts:5-17 (helper)The validateDomain helper function used by the handler to validate and normalize the zone domain name.
export function validateDomain(domain: string): string { if (!domain || typeof domain !== "string") { throw new Error("Domain name is required"); } const trimmed = domain.trim().toLowerCase(); if (trimmed.length > 253) { throw new Error("Domain name exceeds maximum length of 253 characters"); } if (!DOMAIN_RE.test(trimmed)) { throw new Error("Invalid domain name format"); } return trimmed; }