Skip to main content
Glama

dns-mcp

Mentioned in Awesome MCP Servers r0bin2u/dns-mcp MCP server

A Model Context Protocol server that lets any MCP client (Claude Desktop, Claude Code, Cursor, etc.) do DNS, WHOIS, and IP geolocation lookups mid-conversation.

Ask Claude "why is foo.com unreachable from Tokyo?" and it can actually dig the records, check the WHOIS, and geo-locate the IP without leaving the chat.

Features

  • resolve_dns — forward lookup via DNS-over-HTTPS (A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, CAA)

  • reverse_dns — PTR lookup for IPv4 or IPv6

  • whois_domain — structured registration info via RDAP (modern WHOIS)

  • geo_ip — country / city / ASN / ISP for a public IP

  • Bulk / zone transfer queries

  • DNSSEC validation output

  • Local cache (reduce repeated upstream calls)

No API keys required. All four tools hit public free endpoints:

Tool

Upstream

resolve_dns, reverse_dns

dns.google (DNS-over-HTTPS, JSON)

whois_domain

rdap.org (RDAP bootstrap, redirects to TLD registry)

geo_ip

ip-api.com (HTTP, 45 req/min free tier)

Related MCP server: intodns-mcp

Quick Start

Install

pipx install dns-mcp
# or
uv tool install dns-mcp

Claude Desktop

Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):

{
  "mcpServers": {
    "dns": {
      "command": "dns-mcp"
    }
  }
}

Restart Claude Desktop; the four tools should show up in the tool menu.

Claude Code

claude mcp add dns dns-mcp

Codex CLI

Add to ~/.codex/config.toml:

[mcp_servers.dns]
command = "dns-mcp"

Restart Codex. The four tools are then available in any Codex session.

Run from source

git clone https://github.com/r0bin2u/dns-mcp && cd dns-mcp
uv sync
uv run dns-mcp

Example Prompts

  • "What are github.com's A and MX records?"

  • "Who registered cloudflare.com and when does it expire?"

  • "Geolocate 140.82.121.4 — which country and ISP?"

  • "My users in Tokyo say foo.com is slow. Resolve it, then geo-locate the IP."

  • "I got an email from support@paypa1-security.com. Is that domain suspicious?"

Development

uv sync
uv run pytest
uv run ruff check .

Interactive debugging with the MCP Inspector:

npx @modelcontextprotocol/inspector uv run dns-mcp

A note on ip-api.com

The free tier of ip-api.com requires HTTP (not HTTPS). This is fine for geolocating arbitrary public IPs — no credentials are sent — but it means the request is visible on the wire. If that's a concern in your environment, swap in a HTTPS alternative (e.g. ipwho.is, ipinfo.io with a token) by editing IPGEO_URL in src/dns_mcp/__init__.py.

License

MIT — see LICENSE.

Available Tools

4 tools
geo_ipA

Locate an IP address geographically. Returns country, city, ASN, and ISP.

Args:
    ip: Public IPv4 or IPv6 address. Private/reserved ranges are rejected.

Inputs: ip (required).

resolve_dnsA

Resolve a domain name via DNS-over-HTTPS. Returns answer records and TTL.

Args:
    name: Domain to look up, e.g. "github.com".
    record_type: DNS record type. One of A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, CAA.

Inputs: name (required), record_type.

reverse_dnsA

Reverse-resolve an IP address to its PTR record (the hostname it points to).

Args:
    ip: IPv4 or IPv6 address, e.g. "140.82.121.4".

Inputs: ip (required).

whois_domainA

Look up domain registration info via RDAP (the modern structured WHOIS).

Args:
    domain: Domain name, e.g. "github.com".

Inputs: domain (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool addresses a distinct DNS function: geolocation, forward resolution, reverse resolution, and registration lookup. No overlapping purposes.

    Naming Consistency5/5

    All tools use a consistent verb_noun pattern in snake_case (e.g., geo_ip, resolve_dns), making their intent immediately clear.

    Tool Count5/5

    Four tools is well-scoped for a DNS utility server—enough to cover essential operations without redundancy or clutter.

    Completeness4/5

    The set provides forward/reverse DNS, geolocation, and WHOIS. Missing advanced features like bulk queries or DNSSEC validation, but core workflows are complete.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server for DNS lookups, reverse DNS, WHOIS, and domain checks. Zero auth, zero config.
      5
      64 npm
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for IntoDNS.ai providing 36 free tools for DNS, DMARC, SPF, DKIM, BIMI, DNSSEC, MTA-STS, FCrDNS, blacklist and email security checks. Citation-grade report snapshots with content hashes. No API key required.
      45
      156 npm
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for live IP and domain reputation checks via DNS lookups, providing abuse scores and network type without requiring an API key.
      2
      MIT