I connect to work via VPN, and when I connect the VPN connection it sets the default DNS-server to be the one provided by the VPN. Which causes my normal internet to go down the toilet...

How can I stop this from happening, while keeping the possibility to use "myserver.mydomain.local" to connect to VPN-internal servers?

  • Reconfigure your VPN connection...sorry that was snide. It depends on the vpn client really...little more info on what VPN software you are using should provide a more useful answer Dec 8, 2010 at 13:54
  • F5 modem driver. I have tried to reconfigure, but it's not that easy. The client only uses windows dialup with it's own modem-driver to dialup. So I'm left with windows' own settings, which I can't figure out any way to do this... Dec 8, 2010 at 14:05
  • Just to be sure: you do understand the risks when NOT using "Use default gateway on remote network", right? Like when some trojan on your machine is connected to the internet, then that continues being connected while you connect your home network to your work's network. And as apparently your work's sysadmin doesn't allow normal internet usage through the VPN, that sysadmin might not like that at all.
    – Arjan
    Dec 9, 2010 at 9:36
  • Well, this is not something I can control as the VPN-dialer removes this checkbox automatically everytime I connect... So it's actually the sysadmin that has set this variable Dec 9, 2010 at 9:54

3 Answers 3


For Windows 7 I use the following:

netsh dnsclient add dnsservers name="<interfacename>" address= index=1

Something to try, manually define some DNS servers on your local PC(not dhcp)

in the vpn configuration 'Click Advanced and uncheck the box for "Use default gateway on remote network." This will route all of your local traffic through whatever network you're locally connected to, and any remote traffic through the VPN connection. '

then when the vpn comes up it should add the remote DNS server to the END of the list...vpn to resources may take a while to resolve, but it should work. if it still kills your dns, disable dhcp configuration of dns server and set the vpn network dns server manually and at the end of the list

trying to answer another question I ran across this: http://technet.microsoft.com/ru-ru/library/cc786865%28WS.10%29.aspx

the article speculates that you can attach post connect scripts. so you would need to do that and have the post connect script modify your DNS entries.

  • The mentioned checkbox is not checked, and it doesn't matter what I set dns-settings to on the vpn-client, it just resets them upon connection. I could add it on the local network client, but the vpn's dns settings trumps the local connection anyway, so it wouldn't matter... Dec 8, 2010 at 14:43
  • No because the dialer "resets" the ipv4 settings before each reconnect. Dec 8, 2010 at 14:53
  • edited to include a link to a discussion of post-connect scripts on technet Dec 8, 2010 at 18:52
  • (+1, but see my note about "Use default gateway on remote network" below the question.)
    – Arjan
    Dec 9, 2010 at 9:37
  • I might actually give you this one since I practically do it this way except for the script beeing a batch-file and me running it manually... ;) Dec 9, 2010 at 9:55

The easiest way to solve it was to simply create a batch-file that adds extra nameservers and running it after connecting...

netsh interface ip dns "<interfacename>" add index=1

Adding it at index=1 makes it the primary interface

  • 1
    I think the command is: netsh interface ip add dns "<interfacename>" index=1 (on Windows XP, got a command not found error with what CW posted but this worked).
    – JP19
    Jan 19, 2011 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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