mirror of
https://github.com/fosrl/olm.git
synced 2026-05-06 02:37:55 -05:00
[GH-ISSUE #114] DNS resolution fails on systems where NSS routes hostname lookups through systemd-resolved (e.g. Arch Linux) #606
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @andusystems-dev-0 on GitHub (Apr 21, 2026).
Original GitHub issue: https://github.com/fosrl/olm/issues/114
Symptom
After
olmbrings up the tunnel, hostname resolution for tunnel-only hostnames silently fails. Direct lookups against the in-tunnel DNS work:dig @100.96.128.1 foo.example.internal→ correct answergetent hosts foo.example.internal→ emptycurl foo.example.internal/ browsers → NXDOMAIN /NS_ERROR_UNKNOWN_HOSTOlm logs indicate it thinks everything is fine:
/etc/resolv.confis updated as expected:Environment
/etc/resolv.conf/etc/resolv.conf/etc/nsswitch.confhosts line:Root cause
On this NSS configuration, the classic
dnsservice that reads/etc/resolv.confis never consulted:resolve(systemd-resolved) first.pangolintunnel interface and returns NOTFOUND.[!UNAVAIL=return]halts fallthrough —dnsis never tried.So
/etc/resolv.confis functionally irrelevant on these systems. The actual resolver is systemd-resolved, which must be configured per-interface via D-Bus (org.freedesktop.resolve1.Link.SetDNS+SetDomains+SetDefaultRoute).Olm's existing
SystemdResolvedDNSConfiguratoralready does exactly that — the bug is inDetectDNSManager(dns/platform/detect_unix.go), which currently returnsNetworkManagerManagerwithout checking whether NSS even consults thednsservice.Workaround (confirmed)
This is equivalent to what
SystemdResolvedDNSConfiguratordoes via D-Bus.Proposed fix
In
DetectDNSManager, when the file hint isNetworkManagerManagerorResolvconfManager, also inspect/etc/nsswitch.conf. Ifresolveprecedesdns(ordnsis absent) and systemd-resolved is running, returnSystemdResolvedManagerso the D-Bus configurator takes over.PR incoming.
@andusystems-dev-0 commented on GitHub (Apr 26, 2026):
Can also be fixed by adding your Pangolin endpoint to /etc/hosts