Skip to main content
Glama

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
NameRequiredDescriptionDefault
domainYesDomain name to query DNS records for

Implementation Reference

  • 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 });
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mikusnuz/dynadot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server