A problem has arisen with Windows 10 in that it always uses it's local DNS servers (as well as VPN assigned DNS servers) for DNS resolving, which in turn leads to a DNS leakage scenario.

Details found here: (Version 2) https://forums.openvpn.net/viewtopic.php?&t=19728

It is possible, could anybody provide an example, to use a script or batch file etc, which can save the current DNS servers (those set prior to VPN connection), then remove those servers upon successful connection to a VPN and also restore those original servers upon disconnection (or loss) of the VPN connection.

The hooks I would use to execute such a script would be the OpenVPN client directives --up and --down

Many thanks

  • you could just configure your non-tunneled connections to use OpenDNS servers, and just not configure a local DNS at all. Also, remember, VPNs aren't quite TOR. They help with anonymonity, but only as a side-effect; they are designed to present the illusion of being part of the remote network at Layers 2 or 3. If you really want anonymonimity, then half-way measures like sometimes-on VPNs just aren't strong enough. To be anonymous, you must completely segregate the operations you want to be public and those you want to be anonymous. often a live CD is the best bet. – Frank Thomas Sep 16 '15 at 14:44
  • Not sure what device you have on the other end, but one immediate answer to your issue would be to use its firewall to block all traffic out to DNS servers that aren't assigned via OpenVPN. – Frank Thomas Sep 16 '15 at 15:00
  • Thanks for your reply, I am well aware of what a VPN is (I am the author of the link above) .. The problem I have is with Windows 10, which I do not have access to myself, I am trying to provide a solution to many other users of W10. I agree that F/W would suffice, in some cases, but many people would not be comfortable changing their F/W. So the problem remains. Anybody willing to share a script would be recognised as the author of a very welcome solution. – dotvotdot Sep 17 '15 at 16:36
  • well, here's where to start: blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/… – Frank Thomas Sep 18 '15 at 12:08
  • I am unable to test this thoroughly, but this appears to be a possible fix. – dotvotdot Sep 23 '15 at 20:31

At this time, OpenVPN provides a new plugin to control W10 DNS. Please see this for details.

Please notice the work that has gone into this problem with W10 DNS on the OpenVPN bug report. It shows that Microsoft have put in place steps which clearly override the users preference.

https://community.openvpn.net/openvpn/ticket/605 [Resolved]

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.