DNS MCP Server

v1.3.4
io.github.mclose/dns-mcp Checked 10 hours ago Published 8 months ago

Real-time DNS security analysis — DNSSEC, email auth, and RDAP.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

ping

Lightweight health check. Returns server status and timestamp with no external dependencies — no DNS queries, no HTTP requests.

server_info

Show server configuration: dnspython version, configured nameservers, search domains, and default domain. Useful for understanding which resolver the server is using and debugging query behavior.

quine

Return the source code of this MCP server. Reads and returns the contents of server.py via __file__. A diagnostic/introspection tool — no parameters, no external dependencies.

session_stats

Return per-tool call statistics for this container session. Reports uptime, total calls, and per-tool count/errors/latency since container start. Stats reset on every container restart — in-process only, no persistence.

reset_stats

Reset all per-tool call statistics and restart the session clock. Use this to start a fresh measurement window without restarting the container. Returns a confirmation with the new session start time.

dns_query

Query DNS records safely using dnspython library. Performs standard DNS lookups for common record types using the system resolver or a specified nameserver. Returns structured results with TTL information. Supports: A, AAAA, MX, TXT, NS, SOA, CNAME, PTR, SRV, DNSKEY, DS, TLSA, CAA, SSHFP, RRSIG, CDS, CDNSKEY, HTTPS, SVCB, NAPTR record types. No shell execution - pure Python DNS resolution via dnspython.

ParameterTypeDescription
domain *stringDomain name to query (e.g., 'example.com')
nameserverOptional nameserver IP (e.g., '9.9.9.9')
record_typestring

dns_dig_style

Perform a dig-style DNS query showing full response details. Sends a direct UDP query to the specified nameserver and returns detailed response information similar to the `dig` command output. Returns: - Header flags including DNSSEC-related flags (AD=Authenticated Data, CD=Checking Disabled) - Response status (NOERROR, NXDOMAIN, SERVFAIL, etc.) - Answer, Authority, and Additional sections with full record details

ParameterTypeDescription
domain *stringDomain name to query
nameserverstringNameserver to query
record_typestring

dns_query_dot

Perform a DNS over TLS (DoT) query showing full response details. Establishes a TLS session directly to the resolver and sends a DNSSEC-enabled query, similar to: kdig @resolver +tls +dnssec +multi <type> <domain> Returns: - TLS session: protocol version (TLS1.3), cipher suite, key bits - Header: status (NOERROR/NXDOMAIN/SERVFAIL/REFUSED), flags (qr/rd/ra/ad/aa/tc/cd) - EDNS pseudosection: version, DO flag, UDP payload size, padding bytes - Answer, Authority, Additional sections with full record details - Round-trip time in ms

ParameterTypeDescription
domain *stringDomain name to query
nameserverstringResolver IP supporting DoT on port 853 (default: 1.1.1.1)
portinteger
record_typestring

timestamp_converter

Convert between different timestamp formats. Useful for interpreting DNS record timestamps, SOA serial numbers, and other time-based data encountered during DNS analysis. Accepts: - ISO 8601 strings (e.g., "2024-01-15T10:30:00Z") - Unix epoch timestamps (seconds since 1970-01-01) - Human-readable strings (YYYY-MM-DD, MM/DD/YYYY) Returns conversions to ISO, epoch, human-readable, date, time, and unix_ms formats.

ParameterTypeDescription
timestamp *
convert_tostring

reverse_dns

Perform reverse DNS (PTR) lookup for an IP address, with forward-confirmed rDNS (FCrDNS) verification. Converts the IP to its in-addr.arpa / ip6.arpa name, queries PTR records, then resolves each PTR hostname forward (A + AAAA) to confirm it maps back to the original IP. FCrDNS pass is required for trustworthy mail server identity.

ParameterTypeDescription
ip_address *stringIPv4 or IPv6 address for reverse DNS lookup
nameserverstring

dns_dnssec_validate

Perform DNSSEC chain-of-trust validation similar to `delv +vtrace`. Walks the trust chain from the root zone down to the target domain, validating DNSKEY and DS records at each level. Reports whether each step in the chain validates successfully. This tool reconstructs the chain manually (educational "show your work" output) and cross-checks its verdict against the resolver's AD flag on the same query. If the two disagree, a "discrepancy" field explains which to trust and suggests `delv +vtrace <domain>` for final confirmation. Returns: - Chain of trust from root to target domain - Validati…

ParameterTypeDescription
domain *stringDomain name to validate (e.g., 'claude.lab.deflationhollow.net')
nameserverstringDNSSEC-validating resolver to use
record_typestring

check_spf

Retrieve and recursively parse a domain's SPF policy. Enumerates all authorized sending IPs/networks by following include chains. Enforces the RFC 7208 10-lookup limit to prevent infinite recursion. Returns the raw SPF record, parsed mechanisms, authorized networks, the 'all' qualifier, and the total lookup count.

ParameterTypeDescription
domain *stringDomain to check SPF record for (e.g., 'example.com')

check_dmarc

Retrieve and parse a domain's DMARC policy. Queries _dmarc.{domain} for the DMARC TXT record and parses all tags. If no record exists at the exact domain, falls back to the organizational domain (e.g., sub.example.com falls back to _dmarc.example.com). Returns the parsed policy, alignment modes, reporting URIs, and other tags.

ParameterTypeDescription
domain *stringDomain to check DMARC for (the From: domain)

check_dkim_selector

Verify a DKIM public key record exists for a given selector and domain. Queries {selector}._domainkey.{domain} for the DKIM TXT record and parses key parameters. Reports whether the key exists, its type, and whether it has been revoked (empty p= value).

ParameterTypeDescription
domain *stringDKIM domain (d= value from DKIM-Signature header)
selector *stringDKIM selector (s= value from DKIM-Signature header)

check_bimi

Check for BIMI (Brand Indicators for Message Identification) record. Queries {selector}._bimi.{domain} for the BIMI TXT record. Reports whether BIMI is configured, the logo SVG URL, and whether a VMC (Verified Mark Certificate) is present.

ParameterTypeDescription
domain *stringDomain to check BIMI record for
selectorstring

check_mta_sts

Check for MTA-STS (Mail Transfer Agent Strict Transport Security). Queries _mta-sts.{domain} for the DNS TXT record and parses version and policy ID. When fetch_policy is True (the default), also fetches the HTTPS policy file at https://mta-sts.{domain}/.well-known/mta-sts.txt and parses the mode, MX patterns, and max_age.

ParameterTypeDescription
domain *stringDomain to check MTA-STS record for
fetch_policybooleanAlso fetch the HTTPS policy file from /.well-known/mta-sts.txt

check_smtp_tlsrpt

Check for SMTP TLS Reporting (TLSRPT) DNS record. Queries _smtp._tls.{domain} for the TXT record and parses version and reporting URIs. Often paired with MTA-STS.

ParameterTypeDescription
domain *stringDomain to check SMTP TLS Reporting record for

check_dane

Check for DANE TLSA records on a domain's mail servers. DANE binds TLS certificates to DNS via TLSA records, providing cryptographic assurance that a mail server's TLS certificate is the one the domain owner intended. DANE requires DNSSEC — without it, TLSA records are ignored by compliant MTAs. Queries MX records for the domain, then checks _25._tcp.{mx_host} for TLSA records and verifies DNSSEC (AD flag) for each. Classifies each MX host as dane_valid, dane_present_no_dnssec, or no_dane.

ParameterTypeDescription
domain *stringDomain to check DANE for (the From: domain, not the MX hostname)

check_tlsa

Check for TLSA records at an arbitrary host:port:protocol combination. Builds the TLSA FQDN as _{port}._{protocol}.{hostname} and queries for TLSA records with DNSSEC (DO flag set). Reports whether records exist, their parameters (usage, selector, matching type, certificate data), and whether DNSSEC validation confirms authenticity (AD flag). Useful for non-mail DANE (HTTPS on 443, XMPP, etc.) or when you already know the MX hostname and want to check it directly without the MX lookup. For a domain-level mail DANE check across all MX hosts, use check_dane.

ParameterTypeDescription
hostname *stringHostname to check TLSA record for (e.g., 'mx1.example.com')
port *integerPort number (e.g., 25 for SMTP, 443 for HTTPS)
nameserverNameserver IP to query (default: 9.9.9.9)
protocolstring

nsec_info

Probe a zone's DNSSEC denial-of-existence mechanism (NSEC vs NSEC3). Resolves the zone's authoritative nameserver, sends a DNSSEC-enabled query for a synthetic nonexistent name, and parses the NSEC or NSEC3 records returned in the authority section. Reports whether the zone is walkable (i.e., all names can be enumerated). Also queries the NSEC3PARAM record at the zone apex and cross-checks it against actual NSEC3 records to detect re-signing misconfigurations. Example: nsec_info("example.com") might return: denial_type: "nsec" zone_walkable: true walkability_note: "Zone uses plain NS…

ParameterTypeDescription
domain *stringDomain to check (e.g., 'example.com')

rdap_lookup

Retrieve domain registration data via RDAP (modern WHOIS replacement). Looks up the IANA RDAP bootstrap to find the correct server for the TLD, then queries for registration data. Calculates domain age for risk assessment (< 30 days = HIGH RISK, < 90 days = ELEVATED). This is the one tool that makes HTTP calls (not DNS). The domain input is validated before any HTTP request is made.

ParameterTypeDescription
domain *stringDomain to look up via RDAP (registrable domain, not subdomain)

detect_hijacking

Test a DNS resolver for signs of DNS hijacking or tampering. WiFi routers and ISPs sometimes intercept DNS queries and return spoofed responses — captive portals, ad-injection landing pages, or NXDOMAIN redirects. This tool sends five probes directly to the specified resolver and reports a clean/suspicious/hijacked verdict with per-check detail. Checks performed: 1. NXDOMAIN probe — queries a random domain; hijacked resolvers return IPs 2. Known stable record — a.root-servers.net A must return 198.41.0.4 3. DNSSEC AD flag — cloudflare.com A; AD set means resolver validates DNSSEC 4.…

ParameterTypeDescription
resolver *stringIP address of the resolver to test (e.g. 192.168.1.1)

check_rbl

Check an IP address against 8 DNS-based Real-time Blackhole Lists (RBLs). Uses the standard DNS lookup method: reverses the IP octets (IPv4) or nibbles (IPv6), appends the RBL zone, and queries for A + TXT records. An A record answer means the IP is listed; the return code identifies the listing type. RBLs queried (in order): Spamhaus ZEN, SpamCop, UCEProtect L1, UCEProtect L2, Mailspike, PSBL, Barracuda, SORBS Spamhaus ZEN uses zen.spamhaus.org by default (low-volume analyst use). Set the SPAMHAUS_DQS_KEY env var to enable production DQS queries. SORBS may timeout occasionally — han…

ParameterTypeDescription
ip_address *stringIPv4 or IPv6 address to check against DNS-based RBLs
nameserverstring

check_dbl

Check a domain against DNS-based Domain Block Lists (DBLs). DBLs classify domains rather than IPs. Query pattern: {domain}.{dbl-zone}. The registered (org) domain is used for the lookup, stripping subdomains. Lists queried (in order): Spamhaus DBL — classifies: spam / phishing / malware / botnet C2 / abused-legit variants. Direct return-code lookup. URIBL (multi.uribl.com) — bitmask: black / grey / red / multi. SURBL (multi.surbl.org) — bitmask: SC / WS / AB / PH / MW / CRX. Spamhaus DBL uses dbl.spamhaus.org by default (low-volume analyst use). Set SPAMHAUS_DQS…

ParameterTypeDescription
domain *stringDomain to check against DNS-based Domain Block Lists
nameserverstring

cymru_asn

Look up the Autonomous System Number (ASN) for an IP via Team Cymru's DNS service. Step 1 — Origin lookup: IPv4: {reversed_octets}.origin.asn.cymru.com TXT IPv6: {reversed_nibbles}.origin6.asn.cymru.com TXT Response format: "ASN | prefix | CC | registry | allocated" Step 2 — Org name lookup: AS{asn}.asn.cymru.com TXT Response format: "ASN | | CC | registry | allocated | org name" 100% DNS — no HTTP. Authoritative BGP routing data. Flags known bulletproof / high-abuse ASNs from a built-in reference list.

ParameterTypeDescription
ip_address *stringIPv4 or IPv6 address for ASN lookup
nameserverstring

check_fast_flux

Detect fast-flux DNS by querying a domain's A/AAAA records multiple times and comparing the returned IP sets between rounds. Fast-flux is a technique used by botnets and phishing infrastructure to evade takedowns: the domain's records rotate rapidly through a large pool of compromised hosts, with very short TTLs (often < 60 s). Detection heuristic: - Sends query_count rounds of A + AAAA queries with delay_seconds between them. - flux_detected = True when min_ttl < 300 s AND ip_set_changes > 0 Returns: - min_ttl: lowest TTL observed across all answers (seconds) - unique_ips_seen:…

ParameterTypeDescription
domain *stringDomain to probe for fast-flux behaviour
delay_secondsnumberDelay between query rounds in seconds (0.0–5.0)
nameserverNameserver IP (default: 9.9.9.9)
query_countintegerNumber of A/AAAA query rounds to send (3–10)

check_ct_logs

Query Certificate Transparency logs via crt.sh for a domain. Returns all certificates logged for the domain and its subdomains, including: unique names/SANs discovered (useful for subdomain enumeration), per-cert details (issuer, validity, wildcard status), active vs expired counts, and a CAA cross-reference that correctly maps intermediate CA names to their parent CA identity (e.g. E7/E8 -> letsencrypt.org) rather than doing a naive string comparison that produces false positives. Retries automatically -- crt.sh is unreliable and frequently returns empty responses or times out on the first…

ParameterTypeDescription
domain *stringApex domain to query CT logs for (e.g. deflationhollow.net)
include_expiredbooleanInclude expired certificates in the results list (always counted in summary)