Skip to content
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

[Linux] DNS resolution via systemd-resolved broken #7452

Open
2 tasks done
Shadow505 opened this issue Jan 12, 2025 · 6 comments
Open
2 tasks done

[Linux] DNS resolution via systemd-resolved broken #7452

Shadow505 opened this issue Jan 12, 2025 · 6 comments
Labels
bug Daemon Issues related to mullvad-daemon Linux Issues related to Linux

Comments

@Shadow505
Copy link

Shadow505 commented Jan 12, 2025

Is it a bug?

  • I know this is an issue with the app, and contacting Mullvad support is not relevant.

I have checked if others have reported this already

  • I have checked the issue tracker to see if others have reported similar issues.

Current Behavior

The DNS resolution via systemd-resolved is broken as can be seen in the log output.

I also checked the /etc/systemd/resolved.conf file and can confirm that mullvad is NOT writing the DNS server to that file.

In order to get the DNS resolution to work, I need to manually set the IP for the desired dns server in that file.

Expected Behavior

The DNS resolution via systemd-resolved should work.

In case of an error, such as this, there sould be more detailed output to be able to locate the cause of the issue. At the moment, it only says "systemd-resolved operation failed".
What is the exact command that mullvad is trying to execute, that leads to this error?

Steps to Reproduce

Unsure because the log message does not provide enough information...

Please kindly advise me how to find out what exactly mullvad is trying to execute, so that I can debug this further.

I know for a fact, that systemd-resolved itself is working as I am currently using it for the DNS resolution. I did however have to set the desired DNS server manually in the /etc/systemd/resolved.conf file, otherwise it would not be working because - for an unknown reason - mullvad is failing to do so.

Failure Logs

[talpid_core::dns][INFO] Setting DNS servers: Tunnel DNS: {} Non-tunnel DNS: {[REDACTED]}
[talpid_core::dns::imp][DEBUG] Can't manage DNS using systemd-resolved: systemd-resolved operation failed

Operating system version

Archlinux

Mullvad VPN app version

2025.2

Additional Information

No response

@Shadow505 Shadow505 added the bug label Jan 12, 2025
@duxsco
Copy link

duxsco commented Jan 12, 2025

Beware of:
https://wiki.archlinux.org/title/Systemd-resolved#Automatically

Thus, I see your issue more of a problem with your device and not a problem caused by Mullvad VPN.
I have systemd-resolved disabled and switched over to openresolv:
https://gentoo.duxsco.de/network_and_reboot/#1121-openresolv

fyi, I am a fellow Mullvad customer. I don't speak for Mullvad.

@duxsco
Copy link

duxsco commented Jan 12, 2025

Perhaps, Mullvad could publish an article on what to consider for systemd systems.

@duxsco
Copy link

duxsco commented Jan 12, 2025

And, beware that Archlinux isn't an officially supported Linux distro. Only Ubuntu, Debian and Fedora are.
https://mullvad.net/de/download/vpn/linux

@MarkusPettersson98 MarkusPettersson98 added the Linux Issues related to Linux label Jan 13, 2025
@hulthe
Copy link
Contributor

hulthe commented Jan 13, 2025

Hmm. Seems like this can happen if mullvad-daemon was previously managing dns directly through /etc/resolv.conf. The following might help:

sudo systemctl stop mullvad-daemon
sudo ln -fs /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
sudo systemctl start mullvad-daemon

We should probably implement this in the daemon though.

edit: updated commands with duxscos suggestion

@hulthe hulthe added the Daemon Issues related to mullvad-daemon label Jan 13, 2025
@hulthe
Copy link
Contributor

hulthe commented Jan 13, 2025

Also the log message should be improved.

@duxsco
Copy link

duxsco commented Jan 13, 2025

@hulthe Beware that /run/systemd/resolve/stub-resolv.conf is more likely to get used. Overview table: https://wiki.gentoo.org/wiki/Resolv.conf#systemd-resolved

Those three seem to be the only ones to consider:

To improve compatibility, /etc/resolv.conf is read in order to discover configured system DNS servers, but only if it is not a symlink to /run/systemd/resolve/stub-resolv.conf, /usr/lib/systemd/resolv.conf or /run/systemd/resolve/resolv.conf (see below).

Source: https://www.freedesktop.org/software/systemd/man/latest/systemd-resolved.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Daemon Issues related to mullvad-daemon Linux Issues related to Linux
Projects
None yet
Development

No branches or pull requests

4 participants