Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
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 –  hbdgaf Dec 8 '10 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... –  Christian Wattengård Dec 8 '10 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 '10 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 –  Christian Wattengård Dec 9 '10 at 9:54
add comment

3 Answers

For Windows 7 I use the following:

netsh dnsclient add dnsservers name="<interfacename>" address=8.8.8.8 index=1
share|improve this answer
add comment

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.

share|improve this answer
    
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... –  Christian Wattengård Dec 8 '10 at 14:43
    
No because the dialer "resets" the ipv4 settings before each reconnect. –  Christian Wattengård Dec 8 '10 at 14:53
    
edited to include a link to a discussion of post-connect scripts on technet –  hbdgaf Dec 8 '10 at 18:52
    
(+1, but see my note about "Use default gateway on remote network" below the question.) –  Arjan Dec 9 '10 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... ;) –  Christian Wattengård Dec 9 '10 at 9:55
show 2 more comments
up vote 2 down vote accepted

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 8.8.8.8 index=1

Adding it at index=1 makes it the primary interface

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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