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