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 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) |
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.
Metadata
Release files for dns-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dns_mcp-0.1.1.tar.gz | 6.6 kB | Without provenance | Details for dns_mcp-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dns_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for dns_mcp-0.1.1-py3-none-any.whl |
Total release size: 14.3 kB
Release files / dns_mcp-0.1.1.tar.gz
| Download URL | dns_mcp-0.1.1.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cb8e4a5ac5424d125631d485689884af52ba575d2474edb18f4c16fc5101fb0
|
|
BLAKE2b-256 checksum How to use checksums |
2b92f05fa6dbf1ce2f2ece59b3aaeb6fdd9d46b853974551e3e712644f105417
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / dns_mcp-0.1.1-py3-none-any.whl
| Download URL | dns_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc58d19bfe4b91d45dabad2aa78a1a7a358839835d66884c9ab4d2d2f15c6a2b
|
|
BLAKE2b-256 checksum How to use checksums |
df18b4804533cdd7671654c1349860a9edee4946a089559501dac4ef6cbb9033
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for dns-mcp 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.