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 |
|
|
|
|
|
|
Related MCP server: intodns-mcp
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.
Available Tools
4 toolsgeo_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
Scored across 4 tools
Each tool addresses a distinct DNS function: geolocation, forward resolution, reverse resolution, and registration lookup. No overlapping purposes.
All tools use a consistent verb_noun pattern in snake_case (e.g., geo_ip, resolve_dns), making their intent immediately clear.
Four tools is well-scoped for a DNS utility server—enough to cover essential operations without redundancy or clutter.
The set provides forward/reverse DNS, geolocation, and WHOIS. Missing advanced features like bulk queries or DNSSEC validation, but core workflows are complete.
Maintenance
Related MCP Connectors
Free MCP server of security & dev API tools -- supply-chain, CVE, DNS, WHOIS, OFAC, Cosmos SDK.
Public DNS, mail, TLS, and web diagnostics plus Looking Glass probes via remote MCP.
WHOIS, RDAP, DNS, IP / ASN / CIDR and Web3 name (ENS, Unstoppable, Handshake) lookups. No API key.
Free, read-only public-source threat intel over MCP. No account or API key.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for DNS lookups, reverse DNS, WHOIS, and domain checks. Zero auth, zero config.564 npm3MIT
- AlicenseAqualityBmaintenanceMCP 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.45156 npm2MIT
- AlicenseAqualityBmaintenanceMCP server for live IP and domain reputation checks via DNS lookups, providing abuse scores and network type without requiring an API key.2MIT
- AlicenseNot gradedqualityDmaintenanceProvides a no-key IP intelligence API for MCP clients, enabling IP geolocation, VPN/datacenter detection, DNS, WHOIS, blacklist checks, security headers, port scanning, and more.MIT