get_dns
Retrieve DNS records for a domain, including A, AAAA, CNAME, MX, TXT, and SRV records, to manage domain configuration and troubleshoot connectivity issues.
Instructions
Get all DNS records for a domain, including A, AAAA, CNAME, MX, TXT, SRV records, and subdomains.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain name to query DNS records for |
Implementation Reference
- src/tools/dns.ts:31-48 (handler)The MCP tool handler for "get_dns", which calls the Dynadot client.
async ({ domain }) => { try { const result = await client.getDns(domain); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [ { type: "text" as const, text: `Failed to get DNS records: ${msg}` }, ], isError: true, }; } } - src/tools/dns.ts:24-49 (registration)Registration of the "get_dns" tool in the MCP server.
server.tool( "get_dns", "Get all DNS records for a domain, including A, AAAA, CNAME, MX, TXT, " + "SRV records, and subdomains.", { domain: z.string().describe("Domain name to query DNS records for"), }, async ({ domain }) => { try { const result = await client.getDns(domain); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [ { type: "text" as const, text: `Failed to get DNS records: ${msg}` }, ], isError: true, }; } } ); - Dynadot client method that performs the actual API call for "get_dns".
async getDns(domain: string): Promise<DynadotResponse> { return this.call("get_dns", { domain }); }