Probable bug with stubby-openrc
<Boring back story>
Recent firmwares of the generally wonderful Asuswrt-Merlin for Asus routers have a bug where if using DNS over TLS the internet will randomly disconnect. Some users on the relevant forum (https://www.snbforums.com/forums/asuswrt-merlin.42/) say that the routers webui shows 'disconnected', but actually still works. Not in my case, disconnected is disconnected. It seems to vary between models but many seem affected.
Switching to ISP provided DNS and then back to DoT normally fixes it but not always. And in any case at some random point in the future it will disconnect again.
No way I'm using my ISP's DNS
</Boring back story>
Installed stubby and stubby-openrc, resolv.conf to 127.0.0.1, enabled and started stubby. No DNS.
In the log
To be sure I reconstructed the command executed from /etc/init.d/stubby and ran as root
capsh --inh=cap_net_bind_service --user=stubby -- -c '/usr/bin/stubby -C ${STUBBY_CONFIG_FILE:-/etc/stubby/stubby.yml} -v ${STUBBY_LOGLEVEL:-5}'
Searched 'stubby' on here and came across this heaven sent thread:
https://forum.artixlinux.org/index.php/topic,3360.0.html
As root
setpriv --reuid stubby --regid stubby --clear-groups --ambient-caps +net_bind_service --inh-caps +net_bind_service -- '/usr/bin/stubby'
Maybe it's a quirk of my install ? But maybe as is it just doesn't work ?
I'll try and post an alternative, non hackish, /etc/init.d/stubby using setpriv here when I get round to it. Unless one of you, above my pay grade, gets to it first.