Skip to main content
Glama
NsLookup-io

nslookup.io MCP Server

by NsLookup-io

dns_record

Query specific DNS record types for domains to retrieve A, MX, TXT, CNAME, and other DNS data using customizable server options.

Instructions

Look up a specific DNS record type for a domain. Supports 53 record types including A, AAAA, MX, TXT, CNAME, SOA, PTR, CAA, SRV, DNSKEY, DS, TLSA, HTTPS, SPF, and more.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain name (or IP address for PTR lookups) to query (e.g. example.com)
typeYesDNS record type (e.g. A, MX, TXT, CNAME, SPF, HTTPS, DNSKEY)
serverNoDNS server to query. Default: cloudflare. Use 'authoritative' for the domain's own nameservers.

Implementation Reference

  • The handler implementation for the 'dns_record' tool. It validates the input using Zod and calls the `/v1/records/other` API endpoint.
    // Tool 2: DNS Record — get a specific record type
    server.tool(
      "dns_record",
      "Look up a specific DNS record type for a domain. Supports 53 record types including A, AAAA, MX, TXT, CNAME, SOA, PTR, CAA, SRV, DNSKEY, DS, TLSA, HTTPS, SPF, and more.",
      {
        domain: z
          .string()
          .describe(
            "Domain name (or IP address for PTR lookups) to query (e.g. example.com)"
          ),
        type: z.enum(DNS_RECORD_TYPES).describe("DNS record type (e.g. A, MX, TXT, CNAME, SPF, HTTPS, DNSKEY)"),
        server: z
          .enum(DNS_SERVERS)
          .optional()
          .describe(
            "DNS server to query. Default: cloudflare. Use 'authoritative' for the domain's own nameservers."
          ),
      },
      async ({ domain, type, server: dnsServer }) => {
        try {
          const params: Record<string, string> = { domain, type };
          if (dnsServer) params.server = dnsServer;
    
          const result = await apiGet("/v1/records/other", params);
          return { content: [{ type: "text", text: formatJson(result) }] };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error: ${error instanceof Error ? error.message : String(error)}`,
              },
            ],
            isError: true,
          };
        }
      }
    );

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/NsLookup-io/nslookup-mcp'

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