WSL: VPN still problematic
Background
Why does networking not work when connected to VPN when VPN /etc/resolv.conf entries are lower, but works (connected to VPN or not) when VPN entries appear before non-VPN entries? Contrary to what appears to be indicated here and here, I must still follow the advice here to manually edit /etc/resolv.conf to move the VPN entries to the top, then all works well. It seems that it tries all the entries when VPN is first (non-VPN DNS is utilized, after a brief pause, when disconnected from DNS with edited resolv.conf.)
Windows build number
- Microsoft Windows [Version 10.0.15063]
What is happening
- What you’re doing and what’s happening:
- Updated Windows to Creator
- Upgraded Cisco VPN Client (“Cisco AnyConnect Secure Mobility Client”) to version 4.4.02039
- Upgraded WSL when disconnected from VPN, successfully… $ lsb_release -d Description: Ubuntu 16.04.2 LTS
- Check /etc/resolv.conf
$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line.
nameserver 84.200.69.80 # Home DNS1
nameserver 8.8.8.8 # Home DNS2
nameserver fec0:0:0:ffff::1
search Home
- Close Bash
- Connect to VPN in Windows (ensure it is working)
- Check /etc/resolv.conf again
$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line.
nameserver 84.200.69.80 # Same
nameserver 8.8.8.8 # Same
nameserver X.X.X.X # VPN DNS1
search Home americas.company.pvt # VPN FQDN
- Open Bash and try networking, and it fails…
$ ping google.com
ping: unknown host google.com
What works
- What’s wrong / what should be happening instead:
- Disconnect VPN
- Reopen Bash
- Try again, works without issue
$ ping google.com
PING google.com (108.177.96.102) 56(84) bytes of data.
64 bytes from eh-in-f102.1e100.net (108.177.96.102): icmp_seq=1 ttl=42 time=170 ms
64 bytes from eh-in-f102.1e100.net (108.177.96.102): icmp_seq=2 ttl=42 time=163 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 2 received, 33% packet loss, time 2000ms
rtt min/avg/max/mdev = 163.385/167.009/170.634/3.647 ms
- Alternatively, edit /etc/resolv.conf
$ sudo nano /etc/resolv.conf - Remove auto-gen comment line and move VPN entries to top (should the system not continue to work its way down if upper entries fail?)
$ cat /etc/resolv.conf
nameserver X.X.X.X # VPN DNS1
nameserver X.X.X.X # VPN DNS2
search Home americas.company.pvt # VPN FQDN
nameserver 84.200.69.80 # Home DNS1
nameserver 8.8.8.8 # Home DNS2
Straces
- Strace of the failing command, if applicable: (If
<cmd>is failing, then runstrace -o strace.txt -ff <cmd>, and post the strace.txt output here) Direct connect, no changes - no-vpn-working.txt Connected via VPN, no changes - vpn-not-working.txt Connected via VPN, edited resolv.conf - vpn-working-cust-resolv.txt Disconnected from VPN, resolv.conf unchanged from strace above - no-vpn-working-cust-resolv.txt
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 1
- Comments: 43 (5 by maintainers)
If anyone’s interested, I was struggling with this issue for a while and was able to find a solution.
I’m connected to multiple vpns, each has it’s own dns server and manages different domains. This means that everytime I had to connect to hosts in diffrenet vpns I had to changes
/etc/resolv.conf, since name resolution in linux will not try another nameserver (in resolv.conf) if the first nameserver returned an NXDOMAIN (i.e. non-existent domain).Here’s my solution:
Replace the domains (
foo.io,bar.int) with your requirements (or add more if needed) and set the dns IP that will resolve each.Note: I had to manually Disable and Stop the
Internet Connection Sharing (ICS)service as it is binding to port 53./etc/resolv.confenjoy 😄
I realize this is a bit of blog post… but figured anyone who’ll stumble upon this may enjoy this hack.
This is what I get in the log:
When I run
netstat -anp | find ":53"in the command window whether Deadwood is running or not, I get nothing returned. That leads me to believe no service is using port 53. I tried using TCPView (https://docs.microsoft.com/en-us/sysinternals/downloads/tcpview) and did not see port 53 showing up anywhere. I tried all this with and without my Cisco AnyConnect VPN running.For my site, Deadwood + Cisco AnyConnect VPN + WSL works well.
I also have the same problem as above, can’t get Deadwood to work for me.