Commit 648fc58
#195 added the catch-all config generators, upstream parsing and the
forwarding path, and wired none of them in. `dns enable` still called
resolvedConf(tlds) and `dns start` never passed upstreams, so v0.16.0
shipped the capability and none of the behaviour: a box that upgraded got
the same 4586-ending list, the same silent truncation at the resolver's
cap, and the same `curl: (6) Could not resolve host`. The release notes
said routing had stopped being a list. It had not.
Wiring it is the easy half. The hard half is that catch-all routing is
only safe when the bridge can forward what is not ours — point every
lookup at a bridge with no upstreams and the machine loses DNS entirely,
which is far worse than a Moshpit name that does not resolve.
So it is conditional by construction rather than by flag:
- `discoverUpstreams` reads /etc/resolv.conf BEFORE routing is switched,
because afterwards resolv.conf may point at us and the real servers
are no longer discoverable from it
- loopback entries are dropped, so the bridge cannot forward to itself
- upstreams found → `Domains=~.` and the bridge forwards
- none found → the per-ending list, exactly as before, which can
only ever break Moshpit names
- `dns start` passes the same upstreams and the claimed-ending set to
the server, and says which upstreams it will use
The dnsmasq backend follows the same rule, with no-resolv so it does not
inherit upstreams that point back here.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8d534a5 commit 648fc58
3 files changed
Lines changed: 102 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
83 | | - | |
84 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
85 | 100 | | |
86 | 101 | | |
87 | 102 | | |
| |||
99 | 114 | | |
100 | 115 | | |
101 | 116 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
111 | 142 | | |
112 | 143 | | |
113 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
503 | 519 | | |
504 | 520 | | |
505 | 521 | | |
| |||
792 | 808 | | |
793 | 809 | | |
794 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
795 | 818 | | |
796 | 819 | | |
797 | 820 | | |
798 | 821 | | |
| 822 | + | |
| 823 | + | |
799 | 824 | | |
800 | 825 | | |
801 | 826 | | |
| |||
857 | 882 | | |
858 | 883 | | |
859 | 884 | | |
860 | | - | |
| 885 | + | |
861 | 886 | | |
862 | 887 | | |
863 | 888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
0 commit comments