home / mcp / dns mcp server

DNS MCP Server

Provides DNS lookup capabilities for AI assistants across multiple record types with batch, reverse lookups, and trace features.

Installation
Add the following to your MCP client configuration file.

Configuration

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

You deploy a DNS MCP Server to empower AI assistants with fast, flexible DNS lookups across many record types. It supports batch queries, reverse lookups, DNS tracing, and configurable downstream DNS servers, all accessible through a simple MCP interface.

How to use

You interact with the DNS MCP Server through an MCP client. Use it to look up domain records (A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, CAA), perform reverse DNS lookups, run multiple queries in parallel, and trace the full resolution path from root servers to the final answer. You can point the server at your preferred DNS resolvers (for example Google, Cloudflare, or custom servers) and adjust timeouts and retries to suit your needs. If you work with batch needs, you can compose multiple queries into a single operation and receive results in one response.

How to install

Prerequisites: you must have Node.js and npm installed on your system. You should also have a shell environment to run commands.

# Install the DNS MCP Server globally with npm
npm install -g @cenemiljezweb/dns-mcp-server

# Or run it directly with npx without installation
npx @cenemiljezweb/dns-mcp-server

Configuration and running tips

Configure how the server resolves DNS by adjusting your dns-config.json in your working directory. You can specify the DNS servers to use, set a timeout, enable caching, and configure logging. If you want to customize behavior, you can enable or disable TCP usage and tweak retry settings to balance latency and reliability.

To start using with a client, ensure the MCP server is reachable and properly configured. If you are using a local setup, you may run the server directly and point your MCP client at the local instance. If you prefer a remote or managed approach, you can operate via a remote MCP endpoint as well.

Practical examples of capabilities

- Look up a domain for multiple record types in a single operation to gather A, MX, and TXT records. - Retrieve reverse DNS information for a given IP address to map it back to hostnames. - Run several DNS queries in parallel to speed up large workloads. - Trace the DNS resolution path to diagnose where delays or failures occur. - Swap to custom DNS servers to test behavior against different resolvers.

Notes on security and usage

Limit access to the MCP server to trusted clients if you expose it over a network. Use authentication or firewall rules as appropriate for your environment. Keep your DNS configuration up to date and monitor logs to detect unusual activity.

Available tools

dns_lookup

Perform DNS lookups for a domain to retrieve various record types including A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, and CAA.

reverse_dns

Conduct reverse DNS lookups to find the hostname associated with an IP address.

batch_dns

Execute multiple DNS queries in a single operation, with options for parallel execution and timeouts.

dns_trace

Trace the DNS resolution path from root servers to the final result for troubleshooting and insight.