[GH-ISSUE #5199] Linux Client does not correctly detect systemd-resolved causing DNS loops #10762

Open
opened 2026-08-05 01:27:12 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @tom-pryor on GitHub (Jan 27, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5199

Describe the problem

On a Linux system if you are using systemd-resolved and NetworkManager then your contents of /etc/resolv.conf looks something like this before connecting netbird

# Generated by NetworkManager
search xxx
nameserver 127.0.0.53
options edns0 trust-ad

Which in my system causes netbird to use the "file" DNS manager (INFO client/internal/dns/host_unix.go:54: System DNS manager discovered: file) and replaces the nameserver in /etc/resolv.conf with that of the netbird client and uses 127.0.0.53 as the upstream.

This causes problems with DNS loops:

  1. DNS query is sent to value in /etc/resolv.conf, in this case the netbird client
  2. netbird client receives query and forwards it to the upstream 127.0.0.53
  3. systemd-resolved receives this query and since it detects a modified /etc/resolv.conf it uses the value in this file, which has been set to the netbird client, to perform the DNS lookup
  4. The DNS query is sent to the netbird client
  5. Goto 2

DNS lookup does sort of work, as systemd-resolved also queries the DNS servers it detects on the network interfaces of the host and gets correct values from this. However, it becomes noticeable when one of these servers returns some kind of error like NXDOMAIN which appears to cause the DNS requests to timeout rather than instantly return the error.

You can workaround this by adding the string "systemd-resolved" to your /etc/resolv.conf file, e.g:

# Generated by NetworkManager
# hint systemd-resolved
search xxx
nameserver 127.0.0.53
options edns0 trust-ad

The client then detects the correct DNS manager and works fine: INFO client/internal/dns/host_unix.go:54: System DNS manager discovered: systemd

To Reproduce

Steps to reproduce the behavior:

  1. Have a linux system with NetworkManager and systemd-resolved, with NetworkManager configured to use systemd-resolved
  2. Connect to netbird
  3. Observe incorrect DNS manager and loop created

Expected behavior

Either detect the correct DNS manager, allow configuration of the DNS manager used or prompt if the DNS manager used is ambiguous to avoid using the incorrect one.

Are you using NetBird Cloud?

Self hosted

NetBird version

0.64.0

Is any other VPN software installed?

No

Originally created by @tom-pryor on GitHub (Jan 27, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5199 **Describe the problem** On a Linux system if you are using systemd-resolved and NetworkManager then your contents of `/etc/resolv.conf` looks something like this before connecting netbird ``` # Generated by NetworkManager search xxx nameserver 127.0.0.53 options edns0 trust-ad ``` Which in my system causes netbird to use the "file" DNS manager (`INFO client/internal/dns/host_unix.go:54: System DNS manager discovered: file`) and replaces the nameserver in /etc/resolv.conf with that of the netbird client and uses `127.0.0.53` as the upstream. This causes problems with DNS loops: 1. DNS query is sent to value in `/etc/resolv.conf`, in this case the netbird client 2. netbird client receives query and forwards it to the upstream `127.0.0.53` 3. systemd-resolved receives this query and since it detects a modified `/etc/resolv.conf` it uses the value in this file, which has been set to the netbird client, to perform the DNS lookup 4. The DNS query is sent to the netbird client 5. Goto 2 DNS lookup does sort of work, as systemd-resolved also queries the DNS servers it detects on the network interfaces of the host and gets correct values from this. However, it becomes noticeable when one of these servers returns some kind of error like NXDOMAIN which appears to cause the DNS requests to timeout rather than instantly return the error. You can workaround this by adding the string "systemd-resolved" to your /etc/resolv.conf file, e.g: ``` # Generated by NetworkManager # hint systemd-resolved search xxx nameserver 127.0.0.53 options edns0 trust-ad ``` The client then detects the correct DNS manager and works fine: `INFO client/internal/dns/host_unix.go:54: System DNS manager discovered: systemd` **To Reproduce** Steps to reproduce the behavior: 1. Have a linux system with NetworkManager and systemd-resolved, with NetworkManager configured to use systemd-resolved 2. Connect to netbird 3. Observe incorrect DNS manager and loop created **Expected behavior** Either detect the correct DNS manager, allow configuration of the DNS manager used or prompt if the DNS manager used is ambiguous to avoid using the incorrect one. **Are you using NetBird Cloud?** Self hosted **NetBird version** 0.64.0 **Is any other VPN software installed?** No
saavagebueno added the triage-needed label 2026-08-05 01:27:12 -04:00
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#10762