-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: support for sytemd-resolved. #38
Comments
Thanks for the report. My first guess is that this isn't a mox-specific issue. Mox doesn't do anything special to configure DNS servers, or how it talks to them. Are you running this inside docker or directly on the system? And what is in /etc/resolv.conf? It looks like for systemd-resolved, the file /etc/resolv.conf should consist of a line like If you run By the way, it appears that systemd-resolved does not validate dnssec signatures by default. You could enable that (once everything is working), but I personally prefer installing unbound. |
I have no experience with systemd-resolved at all. /etc/resolv.conf is empty but DNS resolution works. When I run dig I get: ; <<>> DiG 9.18.15 <<>> 172.33.19.46.sbl.spamhaus.org Reading https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html, it says:
From this I read that DBUS is the preferred way to resolve using systemd-resolved. |
If /etc/resolv.conf is empty, there's certainly something missing on the machine. It's kind of strange that a new machine wouldn't set up /etc/resolv.conf properly. It has been the place where DNS configuration is stored for decades. I searched around a bit, and for debian I saw mention of package resolvconf, which appears to keep /etc/resolv.conf correct (https://packages.debian.org/bullseye/resolvconf). Which distribution are you using? Perhaps it has a similar package. |
I am running Arch. When reading https://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html, it says:
I will be able to solve this, no problem. (NB: the other options mentioned basically do the same) |
Also interesting to read is https://pkg.go.dev/net#hdr-Name_Resolution. The default for go is to read from /etc/resolv.conf unless you enable CGO that will call C library routines for DNS resolution with which systemd-resolved should be compatible. |
Good info. It would be handy for users if mox could talk to the systemd-resolved. But I'm not enthousiastic about using cgo. It makes reproducible builds and cross-compilation much harder, and it makes it harder to use pre-compiled binaries: I've recently had several cases where a Go cgo binary compiled on one linux wouldn't run on another due to glibc symbol incompatibilities. The Go toolchain is built without cgo now because of this (golang/go#57007). If the systemd-resolved interface is easy enough to implement (one would hope so!), perhaps the Go standard library will grow support for it. But it still seems like /etc/resolv.conf should just have a proper configuration on all systems. The "Note"-section at https://wiki.archlinux.org/title/systemd-resolved#DNS says "Failure to properly configure /etc/resolv.conf will result in broken DNS resolution". I'm wondering how commonly this happens, and if it is on purpose that this isn't set up by default on arch. Perhaps the best that mox can do for now is to recognize if this is happening. I'm going to see if I can get mox to give a helpful hint in the error message if resolving fails with a "connection refused" when the dns server when is 127.0.0.1:53" or "[::1]:53 (https://cs.opensource.google/go/go/+/refs/tags/go1.20.5:src/net/dnsconfig.go;l=14). That should help folks solve the issue without having to start a debugging session. |
…solv.conf, point user to man page of systemd-resolved, the likely cause it seems linux machines with systemd-resolved don't always set up /etc/resolv.conf correctly. there may be no "nameserver" entry, causing Go's net resolver to fallback to 127.0.0.1 and ::1. Systemd-resolved is listening on 127.0.0.53, so users will likely get a "connection refused". So point users to the systemd-resolved manual page. for issue #38 by ArnoSen
Some weeks ago, mox got support for DNSSEC-awareness when doing DNS lookups through a (local) recursive resolver (like unbound, but also systemd-resolved). I've been using unbound, but I also looked at systemd-resolved and its DNSSEC support. It turns out DNSSEC support in systemd-resolved doesn't actually work, and when asked about it is claimed experimental. I wouldn't recommend using systemd-resolved at all. Now that I've done a bit more with DNS, I also think the right API to DNS is just DNS, not some custom systemd-resolved API, so I don't plan on implementing support for systemd-resolved. |
When running quickstart, I get errors like this:
I checked the DNS config on my 'out-of-the-box' VPS and apparently it is configured with systemd-resolved. I wil find my way around it but it would be nice if mox would work with systemd-resolved.
The text was updated successfully, but these errors were encountered: