Page 1 of 1

Windows 10 - use VPN for DNS only

Posted: Wed Jan 19, 2022 9:23 am
by ianmc
Hi all

I am quite new to openvpn.

I hired a basic linode server, for a vpn, tracking/ad blocking - using pi hole + a the unbound dns resolver.

The script I used to setup openvpn was from here: https://github.com/angristan/openvpn-install
It went well.

I setup client for my phone, laptops and PC.

My PC is dual boot window/linux.
Linux is for main use.
Windows is for gaming only.
I wish to use the vpn connection in windows for DNS requests ONLY, to minimize latency in games.

The apt-cache policy openssh-server in the server spurted out:

Installed: 1:8.2p1-4ubuntu0.4
Candidate: 1:8.2p1-4ubuntu0.4

My home LAN is 192.168.1.0.24
The TUN device is 10.8.0.0/24
Home router address/DNS 192.168.1.1
The vpn router address/DNS 10.8.0.1 (pihole)

So it seems I need to put something in a modified client file concerning routes. I am not quite sure.
help appreciated.

Thanks.

Re: Windows 10 - use VPN for DNS only

Posted: Wed Jan 19, 2022 1:22 pm
by TinCanTech
ianmc wrote:
Wed Jan 19, 2022 9:23 am
I wish to use the vpn connection in windows for DNS requests ONLY
Then you do not require push "redirect-gateway" in your server config.

Re: Windows 10 - use VPN for DNS only

Posted: Thu Jan 20, 2022 7:16 am
by ianmc
TinCanTech wrote:
Wed Jan 19, 2022 1:22 pm
ianmc wrote:
Wed Jan 19, 2022 9:23 am
I wish to use the vpn connection in windows for DNS requests ONLY
Then you do not require push "redirect-gateway" in your server config.
Thanks for the reply.

I only wish to do this for one specific client, specifically when using windows 10 on my home PC.
If I did that I think it would do it for all.
For the rest I want all traffic through the vpn as expected.

How is this configured?

Thanks

Re: Windows 10 - use VPN for DNS only

Posted: Thu Jan 20, 2022 7:57 am
by paulchery21
If you wish to do such thing, you should configure your openvpn sessions manually.
you can create a new /etc/openvpn/serverX.conf with new private key and different port number.
Then omit `push "redirect-gateway"` from your new config.

Re: Windows 10 - use VPN for DNS only

Posted: Thu Jan 20, 2022 11:36 am
by ianmc
It seems I found another way.


I have a client setup, specifically my home PC.
It is dual boot windows/linux.
In linux I use the ovpn file generated, and all traffic is through the vpn as expected.
In windows, I copied the .ovpn file and added:

pull-filter ignore "redirect-gateway"

In windows I use the second ovpn file, and it seems to have worked.

Apparently it does not always work.
Thanks for the replies

Re: Windows 10 - use VPN for DNS only

Posted: Thu Jan 20, 2022 3:34 pm
by TinCanTech
The right way would be to setup your server correctly. To do that you will need to read the howto.