How to Permanently Set DNS (VPN Provider Seems to Change it)
I'd like to keep my DNS permanent. AFAIK it's not possible on my system, which isn't good. I believe it's the NordVPN cli app which is changing it. Steps I've taken so far with adding my DNS server of choice:
- edited
/etc/resolv.confand made immutable withchattr - edited
/etc/resolvconf/resolv.conf.d/headand/etc/resolvconf/resolv.conf.d/base - edited
/run/resolvconf/interfaces/tun0 - edited
/etc/NetworkManager/NetworkManager.conf
The network manager and resolvconf head/base files stay as I've edited them, but the /run/resolvconf/interfaces/tun0 file gets changed as does my etc/resolv.conf. I found all these interfaces by looking through several Arch forum threads as well as askubuntu threads, so believe me I am trying. I cannot make the tun0 interface file immutable as apparently the /run filesystem does not accept flags. I just don't want my DNS to change, and NordVPN doesn't seem to be of any help. If anyone knows how to enforce read-only on these files that would be great, or perhaps a better solution. All help is appreciated.
About this post
- Posted
- Archived
- Score
- 8 · 100% up
- Kind
- Text
- ID
- e07tt5
6 comments
Can you not manually set up the VPN profile in nm with your own dns settings?
I originally was doing that, but swapping between servers, a killswitch, and VPN setting management was not quickly performed.
For the moment I'm trying making a symbolic link to my own resolv.conf that's immutable and read only. I tried connecting to a few different servers and it didn't seem to alter the file, so that solution may have worked, albeit a bit hacky.
I'm using OpenVPN so this isn't exactly a solution unless you want to switch away from networkmanager initiating the VPN, but openvpn-systemd-resolved seems to work fine. "openvpn-update-systemd-resolved" in the AUR, or available at https://github.com/alfredopalhares/openvpn-update-resolv-conf. I'm also using PIA, so I can't offer any advice on using Nord with OpenVPN...
I initially had DNS problems when learning to set up a VPN, but they were solved by installing package openresolv. After that, the DNS was properly changed to that of the VPN provider when I start openVPN, then changed back to my "normal" DNS when openVPN is terminated.
Deleted before we saved it.
configuring the app would be the best solution, but if not…
is the vpn app running as root? if not you could make sure it's read-only
if not, you could run the vpn app in a chroot