Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sudden loss of WSL2 DNS for several devs #6722

Closed
devbeard opened this issue Mar 26, 2021 · 8 comments
Closed

Sudden loss of WSL2 DNS for several devs #6722

devbeard opened this issue Mar 26, 2021 · 8 comments
Labels

Comments

@devbeard
Copy link

Environment

Windows build number: Microsoft Windows [Version 10.0.19042.867]
Your Distribution version: Ubuntu, Release:        20.04
Whether the issue is on WSL 2 and/or WSL 1: Linux version 5.4.72-microsoft-standard-WSL2 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Oct 28 23:40:43 UTC 2020

Steps to reproduce

Sudden loss of DNS across multiple dev's computers in enterprise (but not all). Internet connectivity fine, but DNS resolution suddenly no longer works in WSL2.

$ ping google.com
ping: google.com: Temporary failure in name resolution
$ ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether da:f5:e2:00:c9:f9 brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 4e:fd:b7:0d:64:b1 brd ff:ff:ff:ff:ff:ff
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:24:08:3b brd ff:ff:ff:ff:ff:ff
    inet 172.24.95.217/20 brd 172.24.95.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe24:83b/64 scope link
       valid_lft forever preferred_lft forever
5: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.24.80.1
$ dig google.com @1.1.1.1

; <<>> DiG 9.16.1-Ubuntu <<>> google.com @1.1.1.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53373
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             228     IN      A       172.217.21.142

;; Query time: 10 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Fri Mar 26 09:41:09 CET 2021
;; MSG SIZE  rcvd: 55```

On Windows host

❯ Get-NetAdapter

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
Bluetooth Network Connec… Bluetooth Device (Personal Area Networ…      18 Disconnected 04-33-C2-E5-2F-3A         3 Mbps
Ethernet 2                Cisco AnyConnect Secure Mobility Clien…      16 Disabled     00-05-9A-3C-7A-00        10 Mbps
Wi-Fi                     Intel(R) Wireless-AC 9560 160MHz             11 Up           04-33-C2-E5-2F-36       780 Mbps
vEthernet (WSL)           Hyper-V Virtual Ethernet Adapter             44 Up           00-15-5D-3F-86-F4        10 Gbps
Ethernet                  Intel(R) Ethernet Connection (6) I219-…       3 Disconnected F8-75-A4-F2-E4-6F          0 bps

❯ ipconfig /all
[...]
Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter
   Physical Address. . . . . . . . . : 00-15-5D-3F-86-F4
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::7517:82fd:88a8:9cca%44(Preferred)
   IPv4 Address. . . . . . . . . . . : 172.24.80.1(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : 738202973
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-26-8E-6C-8F-F8-75-A4-F2-E4-6F
   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS over Tcpip. . . . . . . . : Enabled
[...]

Expected behavior

Since resolv.conf IP == IPv4 of host, DNS queries should work through host (port 53).

Actual behavior

DNS queries fail.

Temporary failure in name resolution
@K2ouMais
Copy link

K2ouMais commented Apr 1, 2021

Are you using VPN?

@devbeard
Copy link
Author

devbeard commented Apr 7, 2021

No, without a VPN connection. I have since removed everything related to WSL, and reinstalled/reenabled, but with no effect. Still no automatic DNS. I know that I can set the DNS manually, but this used to work flawlessly without - and I am actually more interested in finding out why it does not work than finding a workaround.

@deviantdev
Copy link

Happened to me today, twice.
And Hyper-V adapter network has been changed: 172.016.0.0/12 to 192.168.0.0/24

@meister245
Copy link

meister245 commented Apr 20, 2021

@devbeard Can you ping IP addresses from WSL2?

@devbeard
Copy link
Author

Yes, pinging ips works fine.

@meister245
Copy link

meister245 commented Apr 21, 2021

On my work PC I have the same problem. In the end I found it is some security software called Symantec Endpoint Protection installed by the company, that is actively blocking all IP traffic on WSL2.

https://docs.microsoft.com/en-us/windows/wsl/troubleshooting

See "No internet access in WSL2", it lists products that are known to cause issues.

I am not able to modify this security software (no admin privileges on machine)
The only workaround that fixed my problem is "wsl-vpnkit".

https://github.com/sakai135/wsl-vpnkit

Hopefully I could help.

@JakubKoralewski
Copy link

Had same issue. Restarting fixed it, but still weird.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants