dns-mcp
dns-mcp is an MCP server for DNS, WHOIS, and IP geolocation lookups.
resolve_dns: Look up DNS records (A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, CAA) for a domain via DNS-over-HTTPS, returning answer records and TTL values.reverse_dns: Resolve an IPv4 or IPv6 address to its hostname via PTR record lookup.whois_domain: Retrieve structured domain registration info (registrar, dates, status, etc.) using RDAP, the modern WHOIS replacement.geo_ip: Geolocate a public IPv4 or IPv6 address to get its country, city, ASN, and ISP (private/reserved ranges are rejected).
Allows DNS resolution using Google's DNS-over-HTTPS API, supporting A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, CAA records and reverse DNS lookups.
dns-mcp
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 IPv6whois_domain— structured registration info via RDAP (modern WHOIS)geo_ip— country / city / ASN / ISP for a public IPBulk / 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 |
|
|
|
|
|
|
Quick Start
Install
pipx install dns-mcp
# or
uv tool install dns-mcpClaude 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-mcpCodex 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-mcpExample 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-mcpA 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.
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