Skip to main content
Glama
DNS MCP Server

DNS MCP Server

by cenemil

@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

Related MCP server: nslookup.io 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.

Available Tools

4 tools
batch_dnsC

Perform multiple DNS lookups in a single operation

NameRequiredDescriptionDefault
queriesYesArray of DNS queries to perform
parallelNoExecute queries in parallel
timeoutNoQuery timeout per request
dns_lookupC

Perform DNS lookup for a domain to retrieve various record types (A, AAAA, MX, TXT, etc.)

NameRequiredDescriptionDefault
domainYesThe domain name to lookup
recordTypeNoThe type of DNS record to queryA
useCustomServerNoUse custom DNS server if configured
timeoutNoQuery timeout in milliseconds
dns_traceB

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

NameRequiredDescriptionDefault
domainYesThe domain to trace DNS resolution path
recordTypeNoThe record type to traceA
reverse_dnsB

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

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updates
    • First observedbatch_dns
    • First observeddns_lookup
    • First observeddns_trace
    • First observedreverse_dns

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: batch_dns handles multiple lookups, dns_lookup retrieves standard records, dns_trace traces resolution paths, and reverse_dns maps IPs to hostnames. There is no overlap or ambiguity in functionality.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with underscores (e.g., batch_dns, dns_lookup, dns_trace, reverse_dns). The naming is uniform and predictable across the set.

Tool Count5/5

With 4 tools, the server is well-scoped for DNS operations, covering core functions like lookups, batch processing, tracing, and reverse lookups. Each tool earns its place without being excessive or insufficient.

Completeness4/5

The tools provide comprehensive coverage for DNS querying, including standard and reverse lookups, batch operations, and resolution tracing. A minor gap might be the lack of tools for DNS record management (e.g., create or update), but for a query-focused server, the surface is largely complete.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol tool that provides DNS querying capabilities for various record types (A, AAAA, MX, TXT, CNAME, NS, etc.) through a standardized MCP interface.
    1
    10 npm
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Provides comprehensive tools for real-time DNS queries across 53 record types, global propagation checks, and SSL certificate analysis. It also enables domain security scans for SPF/DKIM/DMARC configurations and HTTP uptime monitoring.
    8
    89 npm
    23
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    A comprehensive DNS query server that enables querying all types of DNS records, including A, AAAA, MX, TXT, NS, CNAME, SOA, PTR, SRV, CAA, and DNSSEC checks, as well as advanced tools like WHOIS-style lookup and DNS delegation tracing.
    1
    -