dns-mcp
dns-mcp
一个 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 密钥。所有四个工具均访问公共免费端点:
工具 | 上游 |
|
|
|
|
|
|
Related MCP server: intodns-mcp
快速开始
安装
pipx install dns-mcp
# or
uv tool install dns-mcpClaude 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-mcpCodex 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。
Maintenance
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
- AlicenseAqualityDmaintenanceMCP server for DNS lookups, reverse DNS, WHOIS, and domain checks. Zero auth, zero config.5483MIT
- AlicenseAqualityAmaintenanceMCP 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.36322MIT
- AlicenseAqualityBmaintenanceMCP server for live IP and domain reputation checks via DNS lookups, providing abuse scores and network type without requiring an API key.2MIT
- Alicense-qualityAmaintenanceEnables domain registration lookup, availability checks, DNS record fetching, and IP/ASN resolution via RDAP and DNS-over-HTTPS through MCP.741Apache 2.0
Related MCP Connectors
Free no-key IP intelligence: geolocation, VPN detection, DNS, WHOIS, blacklists, breach checks
IPInfo MCP — wraps ipinfo.io (free tier, no auth required for basic usage)
ip-api.com MCP.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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