Closed
Description
-
Your Windows build number:
Microsoft Windows [Version 10.0.19041.264] (desktop)
Microsoft Windows [Version 10.0.19041.264] (laptop) -
What you're doing and what's happening:
on wsl2 on my desktop PC, name resolution seems to always fail (i've had it working in the past)
on my laptop, wsl2 name resolution works fine
on my desktop:sudo apt-get update
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease Temporary failure resolving 'archive.ubuntu.com' Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease Temporary failure resolving 'security.ubuntu.com' Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists... Done W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Temporary failure resolving 'security.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead.
ping -c 4 google.com
ping: google.com: Temporary failure in name resolution
ping -c 4 172.217.23.174
(the ip i get fromping google.com
in cmd)PING 172.217.23.174 (172.217.23.174) 56(84) bytes of data. 64 bytes from 172.217.23.174: icmp_seq=1 ttl=54 time=10.9 ms 64 bytes from 172.217.23.174: icmp_seq=2 ttl=54 time=9.72 ms 64 bytes from 172.217.23.174: icmp_seq=3 ttl=54 time=8.60 ms 64 bytes from 172.217.23.174: icmp_seq=4 ttl=54 time=7.85 ms --- 172.217.23.174 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3006ms rtt min/avg/max/mdev = 7.850/9.260/10.865/1.141 ms
-
What's wrong / what should be happening instead:
on my laptop:sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Hit:4 http://download.mono-project.com/repo/debian wheezy InRelease Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Hit:6 https://dl.yarnpkg.com/debian stable InRelease Hit:7 https://download.jitsi.org stable/ InRelease Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [948 kB] Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [322 kB] Get:10 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [724 kB] Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [55.3 kB] Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [13.8 kB] Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1075 kB] Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [334 kB] Get:15 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [229 kB] Get:16 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [45.7 kB] Get:17 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [11.4 kB] Get:18 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [666 kB] Get:19 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [221 kB] Get:20 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [7596 B] Get:21 http://security.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [2824 B] Fetched 4909 kB in 4s (1389 kB/s) Reading package lists... Done
ping -c 4 google.com
PING google.com (172.217.23.174) 56(84) bytes of data. 64 bytes from fra15s22-in-f14.1e100.net (172.217.23.174): icmp_seq=1 ttl=54 time=10.1 ms 64 bytes from fra15s22-in-f14.1e100.net (172.217.23.174): icmp_seq=2 ttl=54 time=9.69 ms 64 bytes from fra15s22-in-f14.1e100.net (172.217.23.174): icmp_seq=3 ttl=54 time=11.4 ms 64 bytes from fra15s22-in-f14.1e100.net (172.217.23.174): icmp_seq=4 ttl=54 time=8.50 ms --- google.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 8.501/9.952/11.462/1.059 ms
ping -c 4 172.217.23.174
(the ip i get fromping google.com
in cmd)PING 172.217.23.174 (172.217.23.174) 56(84) bytes of data. 64 bytes from 172.217.23.174: icmp_seq=1 ttl=54 time=10.6 ms 64 bytes from 172.217.23.174: icmp_seq=2 ttl=54 time=8.54 ms 64 bytes from 172.217.23.174: icmp_seq=3 ttl=54 time=9.20 ms 64 bytes from 172.217.23.174: icmp_seq=4 ttl=54 time=8.16 ms --- 172.217.23.174 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min/avg/max/mdev = 8.163/9.133/10.620/0.935 ms
Activity
vyas0189 commentedon May 29, 2020
I am having the same issue.
AntonyLeons commentedon May 30, 2020
editing the /etc/resolv.conf file, add
nameserver 1.1.1.1
and disable auto generation of the file in /etc/wsl.conf
vyas0189 commentedon May 31, 2020
This didn't work for me.
OmegaRogue commentedon May 31, 2020
That doesn't work for me because i need to use my routers dns because i use that instead of using IPs
12101111 commentedon Jun 23, 2020
I made DNS work by disabling Windows firewall
lukee1234 commentedon Jul 9, 2020
tried this too, but didn't work, that's not the problem
gerardojbaez commentedon Jul 22, 2020
Yet another important issue with WSL 2 and no word from the team. I guess the best and most stable approach right now is to just use a full Linux distribution.
roonie007 commentedon Jul 27, 2020
+1
milianj commentedon Jul 29, 2020
+1
SamuZad commentedon Jul 29, 2020
I'm having the same issue (not using a proxy, or vpn btw). After endless searching, none of the suggested workarounds (turning off firewall, manually overwriting the configuration files) found in other threads resolved the issue, so I had to revert do WSL 1..
It baffles me that an issue that impairs functionality to this degree has not been acknowledged, let alone fixed 2-3 months after "release".
scyto commentedon Jul 29, 2020
Then this is not your issue, you likely have a firewall issue or some other weird networking scenario like VPN clients mucking it up.
The auto populated IP in the resolv.conf should point to the virtual host adapter IP.
This doesn't seem to do DNS resolution (at least it doesn't in the current insider builds), unclear if that is a bug or intentional (it is annoying).
On a fresh WSL install you should always be able to ping say 8.8.8.8 - if you can't ping you don't have a DNS issue you have a networking issue to track down.
scyto commentedon Jul 29, 2020
Sounds like you have an networking issue not a DNS issue - could you ping external IPs?
SamuZad commentedon Jul 29, 2020
The behaviour as follows.
In WSL 1 I can do the following:
In WSL 2 the results are as follows:
234 remaining items