M HYPE SPLASH
// news

Required to call `systemd-resolve` each time I connect to VPN

By Emily Wilson

Whenever I connect to a VPN using OpenVPN I have to run the following command or I cannot access some websites:

sudo systemd-resolve --set-dns=1.1.1.1 --interface=wlp111s0

Is there a way to permanently fix this so that I don't have to run the command every time I connect to the VPN?

In my /etc/openvpn/client.conf I have the following dhcp-option set, where "xxx.xxx.xxx.xxx" are specific DNS servers:

dhcp-option DOMAIN-ROUTE .
dhcp-option DNS xxx.xxx.xxx.xxx
dhcp-option DNS xxx.xxx.xxx.xxx
dhcp-option DNS 1.1.1.1
dhcp-option DNS 8.8.8.8

In my attempts to fix this I have tried adding 1.1.1.1 and corresponding 2606:4700:4700::1111 to my IPv4 and IPv6 network settings (i.e. through the GUI).

I have tried adding them as name servers in /etc/resolv.conf

Out of desperation I have also added it to my /etc/network/interfaces file using this:

auto lo
iface lo inet loopback
iface wlp111s0 inet dhcp dns-nameserver 1.1.1.1

So far none of them have worked.

I am running Ubuntu 18.04.06

Does anyone know why I have to manually set the DNS each time?
Does anyone know how to fix this?

2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy