Skip to content

v0.16.1 — routing stopped being a list, for real this time

Choose a tag to compare

@ralyodio ralyodio released this 01 Aug 14:57
· 130 commits to main since this release
ac9460d

v0.16.0 shipped the catch-all routing machinery and wired none of it in, so upgrading to it changed nothing. This is the version that actually changes routing.

What v0.16.0 got wrong

dns enable still called resolvedConf(tlds) — every claimed ending on one Domains= line. systemd-resolved accepted about 1,090 of them and dropped the rest with no error a caller could see, so moshcode dns resolve <name> answered while curl <name> could not resolve. The v0.16.0 notes said routing had stopped being a list. It had not.

What changes now

Routing is written conditionally, never assumed:

upstreams found routing written worst case
yes Domains=~. — one line, nothing to truncate Moshpit names fail
no the per-ending list, exactly as before Moshpit names fail

Upstreams are read from /etc/resolv.conf before routing is switched, because afterwards it may point at the bridge and the real servers are no longer discoverable from it. Loopback entries are dropped so the bridge cannot forward to itself. Neither branch can take a machine's DNS with it — pointing every lookup at a bridge that cannot forward is a far worse failure than a Moshpit name that does not resolve.

With upstreams configured the bridge answers claimed endings and relays everything else byte for byte, failing open in every direction: an unknown ending set means "not ours", and silent upstreams are SERVFAIL rather than NXDOMAIN, so a lookup is retried elsewhere instead of cached as nonexistent.

Also: the resolver stays up when its socket errors after bind.

Why the list had to go

4,593 endings in the morning, 4,882 by the afternoon, against a resolver cap near 1,090. Every claim made it worse, which is why the fix is not "raise the limit".

Upgrading

moshcode update          # as root
moshcode dns enable      # as root

If a bridge from an older build is already listening on port 5354, dns enable will report "bridge already running" and leave it in place — an older bridge does not forward, so stop it first.