When I disconnect from expressvpn, the resolv.conf file contains expressvpn references that were not there when I connected.
Specifically it sets a nameserver
to a non-existent IP address and adds expressvpn
to the search
domain.
What is the best way to have the expressvpn disconnect
restore my previous resolv.conf. I could wrap the disconnect in a script that restores from a backup, but that requires root -- and there may be a standard way. I don't see anything on the expressvpn site.
As other people have said, it looks like a bug in
expressvpn
. I've used this workaround to make it work: I have made a backup of myresolv.conf
file once, using:And after that when I want to disconnect, I don't run the usual command:
Instead I run:
I don't type it in full, I use Ctrl+R to find it quickly in my bash history. I hope it helps!
ExpressVPN responded that they consider this a feature. So I have done this:
I then hardcode /etc/resolv.conf as at least:
On ExpressVPN connect, this file is replaced with the VPN DNS IPs and on disconnect this resolv.conf is restored.
This has been working through 19.04 to 19.10 without fewer problems than I used to have when
systemd-resolved
was managing the DNS.This worked for me. Exactly the same problem, where ExpressVPN was modifying resolv.conf, but not replacing it when I disconnected from VPN. Now it's working flawlessly.
Add your name servers to base and save, for example:
Copy base to resolv.conf
ExpressVPN Support: Set DNS Servers for Linux