Skip to content

feat(dns): status reports what the resolver accepted, not what we wrote - #197

Merged
ralyodio merged 1 commit into
mainfrom
dns-status-check
Aug 1, 2026
Merged

feat(dns): status reports what the resolver accepted, not what we wrote#197
ralyodio merged 1 commit into
mainfrom
dns-status-check

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Recovers a commit that was orphaned: it was pushed to #195's branch after #195 had already been squash-merged, so it never reached main.

The bug

The check that existed compared the config file against the registry — two numbers we control, which agreed with each other — and said nothing. The resolver is the only party that gets a vote, and it silently declines to take them all: handed 4,586 endings, systemd-resolved accepts ~1,090 alphabetically, rejects the rest one journal line at a time with Argument list too long, and reports success.

That's why moshcode dns resolve chovy.hacker answers while curl chovy.hacker cannot resolve, with dns status calling the routing configured throughout.

Run against a machine in that state

! wrote 4586 endings, the resolver accepted 1090 — 3561 are not routed
  missing: criminology crip cripple cripples crips crochet … and 3553 more
  systemd-resolved caps how many search domains it takes and drops the rest:
    journalctl -u systemd-resolved | grep 'Argument list too long'
  a name in that list answers `moshcode dns resolve` and fails `curl`.

The missing list starts at the alphabetical cut, which is the evidence — .hacker sits past it.

Details

  • Unknown is never "none". A machine with no resolvectl — dnsmasq, macOS, anything not systemd — gets null and is told nothing, rather than told its routing is missing.
  • Still useful after feat(dns): route every lookup here, instead of naming each claimed ending #195. ~. cannot be truncated, so this stays quiet on a catch-all config and keeps reporting for anyone still on a per-ending one — which is every installed copy until they upgrade.

Tests

Included in test/dns-catchall.test.mjs, covering the parser, the shortfall calculation, the unknown-resolver case, and a reproduction of the 4586→1090 cut.

🤖 Generated with Claude Code

The check that existed compared the config file against the registry --
two numbers we control, which agreed with each other -- and said nothing.
The resolver is the one that gets a vote, and it silently declines to
take them all: handed 4586 endings, systemd-resolved accepted 1090
alphabetically, rejected the rest one journal line at a time with
"Argument list too long", and reported success.

That is why `moshcode dns resolve chovy.hacker` answered while `curl
chovy.hacker` could not resolve, with `dns status` calling the routing
configured throughout. Nothing in the output distinguished an ending that
routed from one that had been dropped.

Run against this machine in that exact state, status now says:

  ! wrote 4586 endings, the resolver accepted 1090 — 3561 are not routed
    missing: criminology crip cripple cripples crips crochet … and 3553 more
    systemd-resolved caps how many search domains it takes and drops the rest:
      journalctl -u systemd-resolved | grep 'Argument list too long'
    a name in that list answers `moshcode dns resolve` and fails `curl`.

The missing list starts at the alphabetical cut, which is the evidence:
`.hacker` sits past it.

Unknown is never "none". A machine with no resolvectl -- dnsmasq, macOS,
anything not systemd -- gets null and is told nothing, rather than being
told its routing is missing.

Kept useful after the catch-all lands: `~.` cannot be truncated, so this
stays quiet there and keeps reporting for anyone still on a per-ending
config, which is every installed copy until they upgrade.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio ralyodio mentioned this pull request Aug 1, 2026
@ralyodio
ralyodio merged commit 22c0d6c into main Aug 1, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant