DNS MCP Server

DNS MCP Server

Enables comprehensive DNS operations including lookups for various record types, reverse DNS queries, batch processing, and DNS resolution tracing. Supports multiple DNS servers with configurable caching and robust error handling.

Category
Visit Server

README

@cenemiljezweb/dns-mcp-server

A TypeScript-based Model Context Protocol (MCP) server that provides comprehensive DNS lookup capabilities to AI assistants.

Installation

NPM Global Install

npm install -g @cenemiljezweb/dns-mcp-server

NPX (no install needed)

npx @cenemiljezweb/dns-mcp-server

Features

  • Multiple DNS Record Types: Support for A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, and CAA records
  • Reverse DNS Lookups: Convert IP addresses back to hostnames
  • Batch Queries: Perform multiple DNS lookups in parallel or sequentially
  • DNS Trace: Trace the DNS resolution path from root servers to final result
  • Configurable DNS Servers: Use custom DNS servers (Google, Cloudflare, or your own)
  • Logging: Comprehensive logging with configurable levels
  • Error Handling: Robust error handling with detailed error messages

Quick Start

Using with Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "dns-server": {
      "command": "npx",
      "args": ["@cenemiljezweb/dns-mcp-server"],
      "env": {}
    }
  }
}

Or if installed globally:

{
  "mcpServers": {
    "dns-server": {
      "command": "mcp-dns-server",
      "args": [],
      "env": {}
    }
  }
}

Configuration

The server can be configured using a dns-config.json file in your working directory:

{
  "dns": {
    "servers": ["8.8.8.8", "8.8.4.4", "1.1.1.1", "1.0.0.1"],
    "timeout": 5000,
    "retries": 2,
    "useTCP": false
  },
  "cache": {
    "enabled": true,
    "ttl": 300,
    "maxSize": 1000
  },
  "logging": {
    "level": "info",
    "file": "dns-server.log"
  }
}

MCP Tools Available

1. dns_lookup

Perform DNS lookup for a domain to retrieve various record types.

Parameters:

  • domain (required): The domain name to lookup
  • recordType: Type of DNS record (A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, CAA)
  • useCustomServer: Use custom DNS server if configured
  • timeout: Query timeout in milliseconds

Example:

{
  "domain": "example.com",
  "recordType": "A"
}

2. reverse_dns

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

Parameters:

  • ipAddress (required): The IP address to perform reverse lookup on
  • timeout: Query timeout in milliseconds

Example:

{
  "ipAddress": "8.8.8.8"
}

3. batch_dns

Perform multiple DNS lookups in a single operation.

Parameters:

  • queries (required): Array of DNS queries to perform
    • domain: Domain name
    • recordTypes: Array of record types to query
  • parallel: Execute queries in parallel (default: true)
  • timeout: Query timeout per request

Example:

{
  "queries": [
    {"domain": "example.com", "recordTypes": ["A", "MX"]},
    {"domain": "google.com", "recordTypes": ["A", "AAAA"]}
  ],
  "parallel": true
}

4. dns_trace

Trace the DNS resolution path from root servers to the final result.

Parameters:

  • domain (required): The domain to trace DNS resolution path
  • recordType: The record type to trace (default: A)

Example:

{
  "domain": "example.com",
  "recordType": "A"
}

Development

Local Development

# Clone the repository
git clone https://github.com/yourusername/mcp-dns-server.git
cd mcp-dns-server

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build the project
npm run build

# Run tests
npm test

Scripts

  • npm run build - Compile TypeScript to JavaScript
  • npm run dev - Run in development mode with hot reload
  • npm start - Run the compiled server
  • npm test - Run unit tests
  • npm run lint - Run ESLint
  • npm run typecheck - Run TypeScript type checking

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Author

MCP DNS Server Contributors

Support

For issues and feature requests, please visit the GitHub repository.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured