M
M
m5xim2018-09-19 18:04:10
linux
m5xim, 2018-09-19 18:04:10

How to fix DNS Leak on Ubuntu client?

Hello! There is a problem with a dns leak on Ubuntu 18.04 -
the connection goes through the .ovpn file using standard OS tools (after installing the openvpn and network-manager-openvpn-gnome packages through the settings).
When connected, everything looks correct, ip changes, but blocked sites do not work and dnsleaktest.com shows a leak.
As for the OpenVpn server: it has block-outside-dns and the lines

script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
for Linux clients.
There is no dns leak on Windows and Android clients.
I tried to connect purely through the terminal ( openvpn --config /etc/openvpn/{name}.ovpnas indicated on the website), but the problem remains.
Who faced, tell me what can be done?
UPD: The problem was solved by installing the openvpn-systemd-resolved package and fixing the config
to
script-security 2
up /etc/openvpn/update-systemd-resolved
down /etc/openvpn/update-systemd-resolved
down-pre
# prevent DNS leakage
dhcp-option DOMAIN-ROUTE .
- the reason was Ubuntu's switch from resolvconf to systemd.
Source: askubuntu (second answer).
UPD2 : this solution only works for the standard openvpn console client (i.e. for connecting via terminal openvpn --config /etc/openvpn/{name}.ovpn), when connecting via network manager, the problem remains, so it seems that you need to wait for updates and an official fix.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
ashv24, 2018-09-19
@ashv24

And on the client there is something like this:
dhcp-option DNS "ip address" # use remote DNS
redirect-gateway
And these update-resolv-conf scripts don't work on the ubuntu client? Does it work on Windows and Android? And here comes the leak... What do these scripts do?

G
grabbee, 2018-10-07
@grabbee

Had a similar issue on 16.04. I used the graphical interface to set up the WI-FI network (maybe you have a wire). There IPv4 settings - use only address . There is a similar option in the VPN settings
. Apparently, there should be settings on the server

# DNS servers provided by opendns.com.
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"

But it is not exactly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question