dns_flush_cache
Flush the entire DNS cache to clear all stored records, forcing fresh resolution from upstream servers. Requires confirmation before executing.
Instructions
Flush the entire DNS cache. Forces all subsequent queries to be resolved fresh from upstream. Requires confirm=true to execute.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Must be true to confirm cache flush. Without this, returns a warning instead. |
Implementation Reference
- src/tools/cache.ts:24-41 (handler)The handler function for the dns_flush_cache tool. Requires confirm=true to proceed, then calls the Technitium API /api/cache/flush endpoint to flush the DNS cache.
handler: async (args) => { if (args.confirm !== true) { return JSON.stringify( { warning: "This will flush the entire DNS cache. All subsequent queries will be resolved fresh from upstream, which may temporarily increase latency. Set confirm=true to proceed.", }, null, 2 ); } const data = await client.callOrThrow("/api/cache/flush"); return JSON.stringify( { success: true, message: "Cache flushed", ...data }, null, 2 ); }, - src/tools/cache.ts:8-22 (schema)The tool definition/schema including name, description, and inputSchema (confirm boolean).
definition: { name: "dns_flush_cache", description: "Flush the entire DNS cache. Forces all subsequent queries to be resolved fresh from upstream. Requires confirm=true to execute.", inputSchema: { type: "object", properties: { confirm: { type: "boolean", description: "Must be true to confirm cache flush. Without this, returns a warning instead.", }, }, }, }, - src/tools/cache.ts:5-5 (registration)The dns_flush_cache tool is registered as part of the cacheTools array export, which is imported by src/tools/index.ts (line 8) and aggregated into getAllTools() for the MCP server.
export function cacheTools(client: TechnitiumClient): ToolEntry[] { - src/client.ts:100-113 (helper)The helper method callOrThrow on TechnitiumClient used by the handler to make the /api/cache/flush API call.
async callOrThrow( endpoint: string, params: Record<string, string> = {} ): Promise<Record<string, unknown>> { const result = await this.call(endpoint, params); if (result.status !== "ok") { throw new Error( result.errorMessage || `API error: ${result.status}` ); } return result.response || {}; } - src/rate-limit.ts:25-26 (registration)Rate limiting registration: dns_flush_cache is configured with destructiveLimits (5 requests per 60 seconds) in the RateLimiter constructor.
for (const tool of [ "dns_delete_zone", "dns_delete_record", "dns_flush_cache",