You are not logged in.

#1 2022-08-16 15:12:46

ratcheer
Member
Registered: 2011-10-09
Posts: 891

Getting systemd-resolved to switch when connected to VPN

I have been struggling with this for two days, so I'll try asking.

How do I get systemd-resolved to switch to my VPN provider's DNS when I connect to the VPN?

When my system was using ethernet, I had everything working with manually configured resolv.conf and script update-resolv-conf. But I had to switch to Wi-Fi and I set it up using systemd-resolved. Now, there is a script named update-systemd-resolved in directory /etc/openvpn/scripts, but is does not affect my DNS assignment when I initialize openvpn. The DNS remains assigned to my "everyday" non-VPN servers. This is shown to me by dnsleaktest.com.

I have studied the systemd-resolved and OpenVPN docs, but I have not found anything that addresses this question. Is there a way to make this work with systemd-resolved, or do I need to revert back to the old resolv.conf methods?

PS - One of the things I tried was completely switching to the VPN provider's Linux app, but when I got three levels down into the dependencies, it was requiring Network Manager and gui stuff, which I don't want. My provider is Proton VPN and I was getting the packages from the AUR.

Offline

Board footer

Powered by FluxBB