Windows 10 - use VPN for DNS only

Use this forum to share your VPN or network disasters. Show diagrams, traffic graphs, or whatever else you need (a video of you letting the 'smoke' out of our network gear).

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
ianmc
OpenVpn Newbie
Posts: 3
Joined: Wed Jan 19, 2022 8:59 am

Windows 10 - use VPN for DNS only

Post by ianmc » Wed Jan 19, 2022 9:23 am

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.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Windows 10 - use VPN for DNS only

Post by TinCanTech » 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.

ianmc
OpenVpn Newbie
Posts: 3
Joined: Wed Jan 19, 2022 8:59 am

Re: Windows 10 - use VPN for DNS only

Post by ianmc » Thu Jan 20, 2022 7:16 am

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

paulchery21
OpenVpn Newbie
Posts: 11
Joined: Wed Jan 19, 2022 12:48 pm

Re: Windows 10 - use VPN for DNS only

Post by paulchery21 » Thu Jan 20, 2022 7:57 am

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.

ianmc
OpenVpn Newbie
Posts: 3
Joined: Wed Jan 19, 2022 8:59 am

Re: Windows 10 - use VPN for DNS only

Post by ianmc » Thu Jan 20, 2022 11:36 am

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

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Windows 10 - use VPN for DNS only

Post by TinCanTech » Thu Jan 20, 2022 3:34 pm

The right way would be to setup your server correctly. To do that you will need to read the howto.

Post Reply