diff options
author | Xiao Pan <gky44px1999@gmail.com> | 2023-03-17 02:03:24 -0700 |
---|---|---|
committer | Xiao Pan <gky44px1999@gmail.com> | 2023-03-17 02:03:24 -0700 |
commit | 8cbc96329d88c9eceaeafc8158487ab27303ab43 (patch) | |
tree | 7ecbc278b7a7c1de6fe02e57b82f8cddf60eea53 /etc/NetworkManager | |
parent | 9a85271e7c4016fcf42421d6b60c8c925a489e38 (diff) |
Final fix DNS resolv issues when using mullvad vpn default DNS
Fix can not resolve www.a.com, while a.com is `search a.com` in /run/NetworkManager/resolv.conf and /run/systemd/resolve/resolv.conf, I think `search a.com` is from router.
Fix after suspend can not connect to internet due to mullvad and networkmanager fighting over /etc/resolv.conf and cause resolv.conf be empty. (not sure the cause is correct). This can also be fixed by symlink using systemd-resolved see below.
I do not know why this fix work. I find this fix through trail and error. These changes in configs uses mullvad-vpn, openresolv, dnsmasq, avahi-daemon, and networkmanager. The features are dns cache (dnsmasq) and mdns (avahi-daemon).
The best way to use systemd-resolved with dns cache is `sudo ln -rsf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf`. But I can not find a way to fix the issue of not resolve www.a.com see above. I **guess** the most likely way for systemd-resolved to work is somehow config systemd-resolved to not get DNS from router.
Diffstat (limited to 'etc/NetworkManager')
-rw-r--r-- | etc/NetworkManager/conf.d/NetworkManager.conf | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/etc/NetworkManager/conf.d/NetworkManager.conf b/etc/NetworkManager/conf.d/NetworkManager.conf index aceb13f0..4f325819 100644 --- a/etc/NetworkManager/conf.d/NetworkManager.conf +++ b/etc/NetworkManager/conf.d/NetworkManager.conf @@ -1,5 +1,4 @@ -# If set dns=none and use mullvad vpn, /etc/resolv.conf will have a `search xxx.yyy` line at the end. I don't know why but it seems that line is needed to resolve and connect to xxx.yyy. -# If not set dns=none and not use mullvad vpn, NetworkManager will copy router's DNSes to /etc/resolv.conf and overwirte it which I don't want. There's multiple ways to prevent it: set immutable file attribute, dns=none in NetworkManager.conf, or /etc/resolv.conf.head and /etc/resolvconf/resolv.conf.d/head (need resolvconf?). I only tested dns=none way. The weired thing is in this case `search xxx.yyy` is not needed to reach xxx.yyy [main] # https://wiki.archlinux.org/title/NetworkManager#Unmanaged_/etc/resolv.conf dns=none +rc-manager=resolvconf |