mcp-dns-tools
v2.4.11MCP server for DNS lookups, including CAA checks, reverse DNS, and RDAP-first domain or IP registration data with WHOIS fallback; zero auth, zero config
DNS lookups, reverse DNS, and domain or IP registration checks from your AI assistant. No API keys, no config. Powered by Node.js built-in DNS, HTTPS RDAP, and public WHOIS fallback services. Forked from ofershap/mcp-server-dns and renamed to mcp-dns-tools from v2.0.0 onwards. DNS and registration lookups come up more often than you'd think during development. Debugging email delivery? You need MX records. Auditing certificate issuance? CAA records identify the certificate authorities permitted to issue for a domain. Setting up a new domain? Check the nameservers.
Summary extracted from the README.
mcp-dns-tools
DNS lookups, reverse DNS, and domain or IP registration checks from your AI assistant. No API keys, no config. Powered by Node.js built-in DNS, HTTPS RDAP, and public WHOIS fallback services.
Works with Claude Desktop, Cursor, VS Code Copilot, and any MCP client. Uses Node.js native
dnsmodule, so there's nothing to sign up for.
Forked from ofershap/mcp-server-dns and renamed to mcp-dns-tools from v2.0.0 onwards.
Why
DNS and registration lookups come up more often than you'd think during development. Debugging email delivery? You need MX records. Auditing certificate issuance? CAA records identify the certificate authorities permitted to issue for a domain. Setting up a new domain? Check the nameservers. Investigating a suspicious URL? Registration data identifies the registrar and public ownership details. The existing MCP options for this often require paid API keys. This server uses Node.js built-in DNS resolution, IANA-discovered RDAP services, and public WHOIS fallback services, so it works without accounts or credentials.
Tools
| Tool | What it does |
|---|---|
dns_lookup |
Resolve one requested non-NS record type, including A, MX, TXT, and CAA |
reverse_dns |
Perform reverse DNS (PTR) lookup on an IP address |
resolve_all |
Resolve common record types for a DNS overview; not for one named type |
check_nameservers |
Resolve NS, nameserver, authoritative nameserver, and delegation requests |
whois |
Query domain registration data using RDAP, with WHOIS fallback |
ip_whois |
Query IP allocation data using RDAP, with RIR WHOIS and RIPEstat fallback |
Registration lookup behaviour
The existing whois and ip_whois tool names are retained for client compatibility, but both tools prefer Registration Data Access Protocol (RDAP):
- Domain services are discovered from IANA's RDAP DNS bootstrap registry.
- IP services use the longest matching prefix in IANA's IPv4 or IPv6 RDAP bootstrap registry.
- Bootstrap data is cached in memory for 24 hours.
- Domain lookups follow one advertised registrar RDAP link when available.
- TLDs without working RDAP fall back to public port 43 WHOIS, with at most three queries so registry-to-registrar referrals are supported.
- Unicode domains are converted to IDNA A-labels before lookup.
- HTTPS redirects, response sizes, timeouts, referral destinations, and private or loopback addresses are bounded or rejected.
RDAP is authoritative when it returns 404 Not Found; the tools do not then fall back to potentially stale WHOIS data. On a transport failure, rate limit, or unusable RDAP response, WHOIS is attempted and the result includes a warning explaining the fallback.
ip_whois adds a final last-resort fallback: if both RDAP and RIR WHOIS fail, it queries RIPEstat's RIR whois data over HTTPS. RIPEstat is a secondary aggregator rather than an authoritative source, so successful results are labelled Protocol: RIPEstat (secondary source; data may lag the RIR whois database) and carry the RDAP and WHOIS failure reasons as warnings. The caller identifies itself with the sourceapp=mcp-dns-tools parameter; RIPEstat asks heavy users (more than about 1000 requests per day) to register via the RIPE NCC. Domain whois lookups never use RIPEstat.
Failure reporting
A valid lookup that cannot be completed is returned as MCP error content with separate details for each attempted protocol:
Status: failed
Domain: example.tld
RDAP status: failed
RDAP reason: RDAP_NOT_AVAILABLE
RDAP detail: IANA has no RDAP bootstrap service for this TLD
WHOIS status: failed
WHOIS reason: WHOIS_CONNECTION_REFUSED
WHOIS source: whois://whois.registry.example:43
WHOIS detail: connect ECONNREFUSED
Suggestion: Check outbound HTTPS and TCP port 43 access, then retry.
Stable reasons cover unavailable or missing RDAP, authoritative not-found responses, HTTP errors, rate limits, timeouts, DNS and connection failures, empty or invalid responses, retired or web-only WHOIS services, unsupported query formats, invalid encoding, response-size limits, and rejected, looping, or excessive referrals. For ip_whois, RIPEstat failures add their own reason family (RIPESTAT_NOT_FOUND, RIPESTAT_RATE_LIMITED, RIPESTAT_TIMEOUT, RIPESTAT_NETWORK_ERROR, RIPESTAT_HTTP_ERROR, RIPESTAT_INVALID_RESPONSE, RIPESTAT_DESTINATION_REJECTED). Successful WHOIS or RIPEstat fallback results retain the registration data and include the earlier failure reasons as warnings.
Install
npx -y @paulgit/mcp-dns-tools --transport stdio
Node.js 24 or later is required. The server uses stdio by default; --transport stdio makes the transport explicit in MCP client configuration.
To build from source instead:
git clone https://code.paulg.it/paulgit/mcp-dns-tools.git
cd mcp-dns-tools
npm ci
npm run build
Docker
Run the published image as a stateless MCP Streamable HTTP server:
docker run --rm \
-p 127.0.0.1:3000:3000 \
code.paulg.it/paulgit/mcp-dns-tools:latest
The MCP endpoint is http://127.0.0.1:3000/mcp; the health endpoint is http://127.0.0.1:3000/health. The published image runs as UID 65532 on a shell-less Chainguard Node 24 runtime. It is published for linux/amd64.
The HTTP transport has no built-in authentication. Keep the published port on loopback or put it behind an authenticated reverse proxy before exposing it beyond a trusted network. When proxying, override the image arguments with --transport http --allowed-host mcp.example.com if you want the application to enforce the public Host header too.
Use the same image as a stdio MCP command by overriding its default arguments:
{
"mcpServers": {
"dns": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"code.paulg.it/paulgit/mcp-dns-tools:latest",
"--transport",
"stdio"
]
}
}
}
To build locally with Chainguard's public images:
docker build --platform linux/amd64 -t mcp-dns-tools:local .
docker run --rm -p 127.0.0.1:3000:3000 mcp-dns-tools:local
The public local-build fallback uses Chainguard's standard floating Node image, which includes BusyBox and npm. Forgejo overrides it with the private, versioned base images: release tags use the shell-less, package-manager-free node:24-slim runtime, while development builds (<version>-dev-<sha7>) use the node:24-dev runtime so the published image retains a shell and package manager for debugging. Trivy gates the exact image before any tag is pushed.
For a hardened reference deployment, copy and adjust compose.example.yml:
cp compose.example.yml compose.yml
docker compose up -d
The example binds the service to loopback, uses a read-only filesystem, drops all Linux capabilities, prevents privilege escalation, and inherits the image health check. It also includes commented examples for DNS_SERVERS and reverse-proxy Host-header enforcement.
Optional Agent Skill
The MCP server works without the bundled skill. If your client supports Agent Skills or an equivalent skill format, install the entire skills/dns-lookup directory using that client's skill installation mechanism.
Generic copy:
cp -R skills/dns-lookup /path/to/client/skills/
Generic symlink for repository-based installations:
ln -s /absolute/path/to/mcp-dns-tools/skills/dns-lookup \
/path/to/client/skills/dns-lookup
Consult your client's documentation for its skills directory, then reload or restart the client. Clients without Agent Skills can skip this step; MCP tool descriptions and server instructions provide the essential routing guidance.
Quick Start
Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"dns": {
"command": "npx",
"args": ["-y", "@paulgit/mcp-dns-tools", "--transport", "stdio"]
}
}
}
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"dns": {
"command": "npx",
"args": ["-y", "@paulgit/mcp-dns-tools", "--transport", "stdio"]
}
}
}
VS Code
Add to user settings or .vscode/mcp.json:
{
"mcp": {
"servers": {
"dns": {
"command": "npx",
"args": ["-y", "@paulgit/mcp-dns-tools", "--transport", "stdio"]
}
}
}
}
Examples
- "What are the DNS records for example.com?"
- "Do a reverse DNS lookup on 8.8.8.8"
- "Show me the WHOIS info for github.com"
- "Show me the registration data for nominet.uk"
- "What nameservers does cloudflare.com use?"
- "Resolve all record types for google.com"
- "Check the MX records for my-company.com"
- "Which certificate authorities can issue certificates for example.com?"
- "Check the CAA records for example.com"
- "Who owns the netblock for 8.8.8.8?"
- "Show me the IP WHOIS for 2001:4860:4860::8888"
Troubleshooting
DNS lookups fail with "DNS server refused the query"
Some local resolvers (e.g. Tailscale MagicDNS, some VPNs and corporate DNS) only answer A/AAAA queries and refuse other record types like MX, TXT, CAA, NS, SOA, or CNAME. The server uses Node's built-in resolver, which reads the system DNS configuration.
To use a different resolver, set the DNS_SERVERS environment variable to a comma-separated list of IP addresses:
DNS_SERVERS=8.8.8.8,1.1.1.1 npx -y @paulgit/mcp-dns-tools --transport stdio
Registration lookups fail on a restricted network
RDAP requires outbound HTTPS. Legacy fallback also requires outbound TCP port 43, which many corporate firewalls block. The returned error reports both failures when neither protocol is reachable.
Development
npm test
npm run build
Releases
Releases are prepared by .forgejo/workflows/release.yml when a protected tag matching v*.*.* is pushed. The workflow:
- Requires the tag,
package.json,package-lock.json, andserver.jsonversions to match. - Runs linting, strict type checks, the build, tests, and the production dependency audit.
- Packs the npm tarball and records its npm SHA-1 shasum.
- Uses the runner's Trivy installation and a daily vulnerability database cache.
- Rejects releases with fixed HIGH or CRITICAL vulnerabilities.
- Generates an unfiltered CycloneDX vulnerability disclosure report (VDR) and derives an inventory-only SBOM from it.
- Stages the exact checksummed tarball on npm.
- Creates or updates the Forgejo release in its final, published state, containing the tarball, checksums, SBOM, and VDR.
- Sends an Apprise notification containing the npm stage ID and approval link.
Configure a Forgejo Actions secret named NPM_TOKEN using a granular npm token with read/write access restricted to @paulgit/mcp-dns-tools. The token does not need to bypass 2FA because the workflow uses npm staged publishing.
Configure APPRISE_URL and APPRISE_KEY to receive release notifications. A successfully staged release links to the npm staged-packages page; failures link to the Forgejo workflow run.
Workflow reruns do not attempt to publish an immutable npm version again. The workflow reuses a pending stage when its shasum matches the tarball, treats an already published version with the same shasum as complete, and fails on any mismatch.
To test the release pipeline without creating an npm stage, Forgejo release, or release assets:
- Open Actions in Forgejo and select the Release workflow.
- Select Run workflow and choose the branch or tag to test.
- Leave Stage the npm package and create or update Forgejo release assets disabled.
- Run the workflow.
The dry-run still packs and checksums the package, runs the vulnerability gate, generates and validates the SBOM and VDR, and sends an Apprise result linking to the Forgejo workflow run. Generated files remain inside the temporary runner container and are not uploaded. Enabling the publish option on a manual run requires selecting an existing release tag.
After the workflow succeeds, review and approve the staged package:
npm stage list @paulgit/mcp-dns-tools
npm stage view <stage-id>
npm stage download <stage-id>
npm stage approve <stage-id>
Approval requires 2FA and makes the package public. The Forgejo release is created final by the workflow, so approving the npm stage is the only manual step.
The separate .forgejo/workflows/docker-publish.yml workflow builds the container once, scans that exact image with Trivy, then publishes :<version> and :latest only after a matching vMAJOR.MINOR.PATCH tag passes validation. Manual runs can rebuild an existing release tag or publish an isolated :<version>-dev-<sha7> image.
The Docker workflow also generates a CycloneDX SBOM of the scanned image and attaches it to the Forgejo release as mcp-dns-tools-image-<version>.cdx.json (distinct from the npm-package SBOM and VDR). It refuses to publish an empty inventory, one with under 95% language-package hash coverage (a stale-Trivy-cache signature), or one containing the private Chainguard registry address, and it replaces an existing asset only when byte-identical — a release SBOM is a point-in-time record.
The nightly .forgejo/workflows/sbom-rescan.yml (05:10 Asia/Shanghai) re-scans the latest release's image SBOM with trivy sbom against a fresh vulnerability database, so newly disclosed CVEs in already-shipped images surface without a rebuild. It attributes each finding to the base image or an application dependency, verifies the vulnerability database is fresh (at most 48 hours old), and tracks results in a rolling SBOM Re-scan issue. Apprise is notified only on run failure or actionable (fixable, non-dismissed) findings; a clean scan pages nobody. Findings can be dismissed by adding an entry to .auditrc.json (with id, package, reason, accepted, and expires fields) — never by editing the workflow. Releases older than the SBOM workflow carry no asset, so the nightly job fails loudly with a "cut a new release first" message until the next release is cut.
The Docker workflow uses these Forgejo repository secrets:
CHAINGUARD_REPO,CHAINGUARD_PULL_TOKEN_USERNAME, andCHAINGUARD_PULL_TOKENfor the private Node 24-devand-slimbase images.REGISTRY_USERandREGISTRY_TOKENforregistry.paulg.itpushes.RUNNER_TOKEN, a scope-limited PAT, for release-asset upload (Docker workflow) and download (nightly re-scan).APPRISE_URLandAPPRISE_KEYfor completion notifications.
Tool routing smoke test
After changing tool metadata, run these prompts in each supported MCP client with and without the optional skill installed:
| Prompt | Expected call |
|---|---|
| Check the CAA records for fastmail.com | dns_lookup, type: "CAA" |
| Which CAs may issue certificates for example.com? | dns_lookup, type: "CAA" |
| Check the MX records for example.com | dns_lookup, type: "MX" |
| Check the NS records for example.com | check_nameservers |
| What nameservers does example.com use? | check_nameservers |
| Show all DNS records for example.com | resolve_all |
| Give me a DNS overview for example.com | resolve_all |
| Check the CAA and MX records for example.com | resolve_all or two dns_lookup calls |
| Check the NS and MX records for example.com | resolve_all or two specific calls |
| Who is the registrar for example.com? | whois |
| Who owns the netblock for 8.8.8.8? | ip_whois |
Record the selected tool and arguments. Rebuild the server and reconnect the client before each test run so it refreshes MCP instructions and tools/list metadata.
License
MIT © 2026 Ofer Shapira, 2026 Paul Git