Skip to main content
Glama

dns-mcp

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

一个 Model Context Protocol 服务器,允许任何 MCP 客户端(Claude Desktop、Claude Code、Cursor 等)在对话中进行 DNS、WHOIS 和 IP 地理位置查询。

询问 Claude “为什么 foo.com 在东京无法访问?”,它无需离开聊天界面即可实际查询记录、检查 WHOIS 并定位 IP 的地理位置。

功能

  • [x] resolve_dns — 通过 DNS-over-HTTPS 进行正向查询 (A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, CAA)

  • [x] reverse_dns — IPv4 或 IPv6 的 PTR 查询

  • [x] whois_domain — 通过 RDAP(现代 WHOIS)获取结构化注册信息

  • [x] geo_ip — 获取公共 IP 的国家/城市/ASN/ISP 信息

  • [ ] 批量/区域传输查询

  • [ ] DNSSEC 验证输出

  • [ ] 本地缓存(减少重复的上游调用)

无需 API 密钥。所有四个工具均访问公共免费端点:

工具

上游

resolve_dns, reverse_dns

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

whois_domain

rdap.org (RDAP bootstrap,重定向至 TLD 注册局)

geo_ip

ip-api.com (HTTP, 免费层级 45 次请求/分钟)

Related MCP server: intodns-mcp

快速开始

安装

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

Claude Desktop

添加到 claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\):

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

重启 Claude Desktop;这四个工具应该会出现在工具菜单中。

Claude Code

claude mcp add dns dns-mcp

Codex CLI

添加到 ~/.codex/config.toml:

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

重启 Codex。之后这四个工具即可在任何 Codex 会话中使用。

从源码运行

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

示例提示词

  • “github.com 的 A 记录和 MX 记录是什么?”

  • “谁注册了 cloudflare.com,它什么时候过期?”

  • “定位 140.82.121.4 — 是哪个国家和 ISP?”

  • “我在东京的用户说 foo.com 很慢。解析它,然后定位该 IP 的地理位置。”

  • “我收到了一封来自 support@paypa1-security.com 的邮件。这个域名可疑吗?”

开发

uv sync
uv run pytest
uv run ruff check .

使用 MCP Inspector 进行交互式调试:

npx @modelcontextprotocol/inspector uv run dns-mcp

关于 ip-api.com 的说明

ip-api.com 的免费层级需要 HTTP(而非 HTTPS)。这对于定位任意公共 IP 是没问题的——因为不会发送凭据——但这意味着请求在网络传输中是可见的。如果这在您的环境中是一个问题,请通过编辑 src/dns_mcp/__init__.py 中的 IPGEO_URL 来替换为 HTTPS 替代方案(例如 ipwho.is,或带有令牌的 ipinfo.io)。

许可证

MIT — 参见 LICENSE

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    A
    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.
    36
    32
    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

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

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/r0bin2u/dns-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server