Skip to main content
Glama
cenemil

DNS MCP Server

by cenemil

reverse_dns

Find the hostname associated with an IP address using reverse DNS lookup. This tool resolves IP addresses to domain names for network analysis and troubleshooting.

Instructions

Perform reverse DNS lookup to find the hostname for an IP address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipAddressYesThe IP address to perform reverse lookup on
timeoutNoQuery timeout in milliseconds

Implementation Reference

  • src/index.ts:75-92 (registration)
    Registration of the 'reverse_dns' tool in the TOOLS array, including name, description, and input schema.
    {
      name: 'reverse_dns',
      description: 'Perform reverse DNS lookup to find the hostname for an IP address',
      inputSchema: {
        type: 'object',
        properties: {
          ipAddress: {
            type: 'string',
            description: 'The IP address to perform reverse lookup on'
          },
          timeout: {
            type: 'number',
            description: 'Query timeout in milliseconds'
          }
        },
        required: ['ipAddress']
      }
    },
  • Handler for 'reverse_dns' tool: parses input, calls DnsResolver.reverseLookup, formats and returns result.
    case 'reverse_dns': {
      const input = ReverseDnsSchema.parse(args) as ReverseDnsInput;
      logger.info(`Reverse DNS lookup for ${input.ipAddress}`);
      const hostnames = await dnsResolver.reverseLookup(input.ipAddress);
      logger.debug('Reverse DNS result', hostnames);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              ipAddress: input.ipAddress,
              hostnames,
              timestamp: new Date().toISOString()
            }, null, 2)
          }
        ]
      };
    }
  • Zod schema defining input validation for reverse_dns tool.
    export const ReverseDnsSchema = z.object({
      ipAddress: z.string().ip().describe('The IP address to perform reverse lookup on'),
      timeout: z.number().min(100).max(30000).optional().describe('Query timeout in milliseconds')
    });
  • Core implementation of reverse DNS lookup using Node.js dns.promises.Resolver.reverse() method.
    async reverseLookup(ipAddress: string): Promise<string[]> {
      try {
        return await this.resolver.reverse(ipAddress);
      } catch (error: any) {
        throw {
          code: error.code || 'REVERSE_LOOKUP_FAILED',
          message: error.message || 'Reverse lookup failed',
          domain: ipAddress
        } as DnsError;
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the core function but lacks details on error handling (e.g., for invalid IPs), rate limits, network dependencies, or what happens on timeout. For a network tool with potential failures, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste—it directly states the tool's purpose without fluff. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly and understand the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a network tool. It doesn't cover behavioral aspects like error responses, return format (e.g., hostname string or structured data), or network constraints. For a tool with potential complexity in DNS resolution, this leaves critical gaps for an agent to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('ipAddress' and 'timeout') clearly. The description implies the 'ipAddress' parameter but adds no extra meaning beyond what the schema provides, such as format examples (IPv4 vs. IPv6) or timeout implications. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Perform reverse DNS lookup') and the resource ('IP address'), with the goal of finding the hostname. It directly distinguishes from sibling tools like 'dns_lookup' (likely forward lookup) and 'dns_trace' (likely diagnostic tracing), making the purpose unambiguous and well-differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'batch_dns' (for multiple lookups) or 'dns_lookup' (forward DNS). It states what the tool does but offers no context about appropriate scenarios, prerequisites, or exclusions, leaving the agent to infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/cenemil/dns-mcp-server'

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