You are not logged in.

#1 2018-12-28 00:00:07

bbsned
Banned
From: Amsterdam
Registered: 2018-12-27
Posts: 8

[SOLVED] openvpn dns leak using openvpn-update-systemd-resolved

Just tying out Archlinux so if I can move away from ubuntu.
Installed all my applications no problems there, then began with openvpn to connect to online vpnservice

First had to find out my systemd version:
#/sbin/init --version
output : systemd 239

Because of :
Since systemd-229, the systemd-resolved service has an API available via DBus which allows directly setting the DNS configuration for a link. This script makes use of busctl from systemd to send DBus messages to systemd-resolved to update the DNS for the link created by OpenVPN.

The installed with AUR

sudo pacman -S --needed base-devel git

Get the Git Clone URL: from page
https://aur.archlinux.org/packages/open … -resolved/

Get the Git Clone URL = https://aur.archlinux.org/openvpn-updat … solved.git

Install:
#git clone https://aur.archlinux.org/openvpn-updat … solved.git

#cd openvpn-update-systemd-resolved

And Compile it

#makepkg -si

First time I used AUR

After some reading...

Make sure that you have systemd-resolved enabled and running:

#systemctl enable systemd-resolved.service
#systemctl start systemd-resolved.service

#chmod 755 /etc/openvpn/scripts/update-systemd-resolved

And add the openvpn-update-systemd-resolved script lines to the end of the .ovpn file

script-security 2
setenv PATH /usr/bin
up /etc/openvpn/scripts/update-systemd-resolved
down /etc/openvpn/scripts/update-systemd-resolved
down-pre

And started openvpn fo first try:
#sudo openvpn --config shadeyou.ovpn --auth-nocache

Machine connected fine checked my ip and location and it was connected to the vpn server.

Next check the dns-leak that's what's openvpn-update-systemd-resolved script is for.

https://www.dnsleaktest.com/

And I get my internet providers dns and not the vpn dns so I have a DNS leak!

I checked systemd-resolved.service is running...

What can I do to solve dns leak

Last edited by bbsned (2019-01-02 16:25:27)

Offline

#2 2018-12-28 21:39:10

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] openvpn dns leak using openvpn-update-systemd-resolved

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-12-28 21:59:58

bbsned
Banned
From: Amsterdam
Registered: 2018-12-27
Posts: 8

Re: [SOLVED] openvpn dns leak using openvpn-update-systemd-resolved

Found the solution to have NO dns leak.

The .ovpn file where to add at the end the lines for the script to start, just add before that : dhcp-option DOMAIN-ROUTE .  (with the . )
The dot/period matches all domain names.
so like this

dhcp-option DOMAIN-ROUTE .
script-security 2
up /etc/openvpn/scripts/update-systemd-resolved
down /etc/openvpn/scripts/update-systemd-resolved
down-pre

Source
https://github.com/jonathanio/update-sy … /issues/28

Last edited by bbsned (2018-12-28 23:41:10)

Offline

#4 2018-12-28 22:11:34

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] openvpn dns leak using openvpn-update-systemd-resolved

What, exactly, about "use code tags" do you not understand?

You have been asked twice now to read the Code of Conduct, your third warning will be the final one.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB