fix(resolved): the fallback resolver is the bug, not the safety net - #17
Merged
Conversation
00-moshpit.conf assumed systemd-resolved "uses the first server for every query, rotating only on failure", so listing DigitalOcean's resolvers after the bridge was harmless insurance. It rotates away from a failing server and does not rotate back. One restart of moshpit-dns moves every query to the fallback permanently, and the fallback answers NXDOMAIN for every Moshpit name — so DNS looks healthy while the whole namespace is dead. That is the worst shape a failure can take: nothing is obviously broken to look at. Seen three times in one afternoon before it was understood. `dig @127.0.0.1 -p 5354 seo.rank` answered, `curl seo.rank` did not, and resolvectl showed the bridge listed and 67.207.67.3 current. The fallback also buys nothing. The bridge forwards what it cannot answer upstream itself (mode=clearnet), so a second entry adds no capability — only that failure. If the bridge stops, restart it: the unit already does, in two seconds. Two seconds of no DNS beats an afternoon of DNS that lies. Documents that this must be the only drop-in setting DNS=, and how to remove the others.
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
00-moshpit.confreasoned carefully about drop-in ordering and reached the wrong conclusion. Its comment says:The half that is missing: it rotates away from a failing server and does not rotate back.
What that costs
One restart of
moshpit-dnsmoves every query to the fallback, permanently. The fallback answersNXDOMAINfor every Moshpit name, so:DNS looks healthy.
google.comresolves. Only the namespace this box exists to serve is dead, and nothing insystemctl statusorresolvectlreads as an error. That is the worst shape a failure can take, and it happened three times in one afternoon before the cause was understood — each time diagnosed as something else.The fallback buys nothing
The bridge already forwards what it cannot answer to the upstreams itself (
mode=clearnet— the ordinary internet owns any name it can answer, the registry is only a backfill). So a second entry adds no capability, only that failure mode.And if the bridge does stop, the answer is to restart it — which
moshpit-dns.servicealready does in two seconds (Restart=always,RestartSec=2). Two seconds of no DNS beats an afternoon of DNS that lies.The change
Comment only — the
[Resolve]block is unchanged. It now states the contract this file depends on but never said out loud: it must be the only drop-in settingDNS=, with the commands to remove the others and the one-line check that confirms it:A file whose correctness depends on nothing else existing should say so, because the failure when something else does exist is invisible.
Worth considering separately
install.shdoes not manageresolved.conf.dat all, so this drop-in is placed by hand or bymoshcode dns enable— and the latter wrote a third file (moshpit.conf) setting the same key plusDomains=~., which this file deliberately omits. Two files disagreeing about one setting is its own hazard. Making the installer own the directory would close it, but that is a bigger change than this one.