CLI-Anything Bundle #23 — DNS Deep Recon Pack
Four NEW agent-native CLI harnesses that answer the four "where does this machine's name resolution actually come from" questions every AI agent runs into but usually improvises: what does resolv.conf point at, what does the hosts file claim, which sources does nsswitch pick in what order, and what does a resolver actually answer on the wire. Config layers are read-only with zero network I/O; the one tool that sends queries declares every packet in its own envelope. Nothing is guessed, nothing is inferred — records are carried verbatim.
What's inside
- resolvpeek — resolver config truth with per-row provenance: every nameserver/search/option row carries its source line and an address class derived from the address itself (loopback, link-local, multicast, zeroaddr, TEST-NET, private, global-other, systemd-resolved stub, v4-mapped). Known stubs (127.0.0.53/54) detect and read /run/systemd/resolve/resolv.conf so BOTH the stub and the real upstream are named — each upstream row flagged from_stub_upstream. Duplicate nameserver IPs and repeated search names surface with all their lines; unknown options carry an honest known:false verdict (meaning never invented); the file's own symlink chain is walked with lstat so a redirected /etc/resolv.conf is visible. No network I/O at all — servers are never probed; reachability is a runtime fact, not a config fact.
- hostspeek — hosts-file census: entry rows with line, ip, address_class (loopback / sinkhole-block / multicast / link-local / TEST-NET / private / broadcast), canonical, aliases, and inline comments carried verbatim. Duplicates surface, never cleaned silently: the same name on multiple lines, one name resolving to conflicting addresses within the file, one address carrying many names — and a name appearing twice in ONE entry (canonical + alias) is NOT a cross-line repeat, battery-asserted. Malformed rows are counted with reasons, never dropped. Names are NEVER resolved; how this file ranks against DNS is nsswitch truth (nsspeek's lane), named as a note, never claimed.
- nsspeek — nsswitch resolution-order truth: one row per database with sources in exact file order, bracket action clauses ([NOTFOUND=return], [!UNAVAIL=return]) attached to the source they modify, duplicate sources flagged, redeclared databases carrying all line numbers. Well-known sources named from a fixed table (files, dns, resolve, myhostname, mdns*, nis, ldap, compat, winbind); anything outside it is known:false with "meaning not invented". Question-shaped verdicts for the hosts database: myhostname shortcut? mdns before dns? resolve AND dns both chained (systemd-resolved double path)? files first? When the file is absent the glibc default (files -> dns) is CARRIED and LABELED — absence is a finding, not a crash. Database-name parsing follows the file format (everything before the colon), so the terse
hosts:ldap form parses identically to hosts: ldap.
- dnsqpeek — raw-wire DNS query matrix: speaks DNS itself over UDP/53 (header flags, QNAME labels, compression-aware answer parsing) so A + AAAA + MX + NS + TXT answer in one shot (or any of 8 types one at a time), each row with RTT in ms, decoded rcode (NOERROR / NXDOMAIN / REFUSED / SERVFAIL), per-record renders (A dotted quad, AAAA hex groups, MX preference+exchange, TXT strings, CNAME/NS/PTR names, root rendered as "." with a named note), CNAME chains carried, TTLs passed through — nothing cached, deduplicated or inferred. Default server = resolv.conf's first nameserver with stub detection preferring the real upstream (labeled in the envelope); --server overrides. The ONLY network I/O in the bundle happens here and is declared per run (udp_queries_attempted / servers_contacted / ports). UDP only — a truncated reply is a declared limit, never auto-retried over TCP. NXDOMAIN and REFUSED are honest answers ABOUT the resolver, not failures of the tool.
The pipeline that matters
resolvpeek (where resolver requests point) → nsspeek (which sources run, in what order) → hostspeek (what the hosts file claims before DNS is consulted) → dnsqpeek (what the chosen resolver actually answers on the wire). Four stages; the resolution chain stays honest end to end.
Install — one step per skill
Copy each skill folder (the one containing its SKILL.md) into your agent's skills directory:
cp -r resolvpeek hostspeek nsspeek dnsqpeek ~/.openclaw/skills/
Works with OpenClaw, Claude Code, Codex, or any Agent-Skills-convention runtime. Every skill also runs as a plain CLI (no agent needed):
python3 resolvpeek/agent-harness/cli_anything/resolvpeek/__main__.py --json
python3 hostspeek/agent-harness/cli_anything/hostspeek/__main__.py --json
python3 nsspeek/agent-harness/cli_anything/nsspeek/__main__.py --json
python3 dnsqpeek/agent-harness/cli_anything/dnsqpeek/__main__.py matrix example.org --json
Verify before you trust
Every skill ships a self-test battery — synthetic fixtures plus live fire on the running host:
python3 runner_count.py resolvpeek/agent-harness/cli_anything/resolvpeek/tests/test_core.py
python3 runner_count.py hostspeek/agent-harness/cli_anything/hostspeek/tests/test_core.py
python3 runner_count.py nsspeek/agent-harness/cli_anything/nsspeek/tests/test_core.py
python3 runner_count.py dnsqpeek/agent-harness/cli_anything/dnsqpeek/tests/test_core.py
Verified 2026-10-23 on the build host: 129 + 97 + 91 + 182 = 499 checks, 0 failed, 0 errors (check counts adapt to your host's environment state; 0 failed is the contract). Real defects found by the batteries were repaired in staging before the clean fires — the shipped files are the fired files. Wire-format coverage is synthetic byte-by-byte packets (compression pointers, CNAME chains, null MX, malformed truncations); the timeout class fires against RFC 5737 TEST-NET-3, never against a real resolver.
Safety contract
Reads only the on-disk surfaces each skill documents (see each SKILL.md), computes with the stdlib, writes nothing, spawns nothing. dnsqpeek is the only skill that touches the network and it declares every query in its own envelope — UDP/53 to one resolver you chose or the live config named, nothing binds, nothing listens, nothing else connects. Unusable surfaces report honestly (exit 2); impossible requests are named refusals (exit 1), never stack traces.
Support: [email protected] — subject "BUNDLE23 DNSDEEP" plus your question. Include your order number.
Built on SoulTech AI. All Is One. One Is All.