You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is here to merge DNS related issues in WSL2.
Symptoms include:
DNS resolution failing with Temporary failure in name resolution
DNS resolution timing out
This issue does not cover scenarios where /etc/resolv.conf is manually edited.
If you're hitting this, please upvote / comment and upload logs
Reacted by Odbayar Nyamtseren, Stijn Herreman, Azuresonance, Ben Hillis, Junyang Chen, Subhash Bose, Louis Barbaglia, Kai Mast, Vijay Dharap, Seth Wenzel and 230 more
Reacted by sommer-gei, Alexandre Desjardins, Jonathan Simpson, Stephen Connolly, Guillaume Husta, Arun Karikalan and Dr Awktopus
Craig Hutchinson (@CraigHutchinson) , your comment appears to mimic what I'm seeing, where the problem is somehow in the routing and not just the name resolution. Have you found any workarounds?
There were multiple open issues, all about the functionally same issue. Hence, as the initial description says, this exists to merge and declutter them.
There were multiple open issues, all about the functionally same issue. Hence, as the initial description says, this exists to merge and declutter them.
If this leads to a fix, this is a great outcome.
However the way it was handled may alienate the community. i.e., closing all the related issues without discussion or a clear reason provided in those issues.
Reacted by Michael Kaiser-Cross, Pieter, Janne Kujanpää, Ben Voris, Dominik Mattioli and Ted Lin
It might be to do with Windows Defender settings. resolv.conf and wsl.conf based approach didn't work for me.
sudo apt update && sudo apt upgrade worked immediately after I turned off the Private network firewall. Once the update completed, I've put the firewall for private network back on.
On Windows 11, Go to Windows Security (from system tray, right click on Windows Security icon and select "View security dashboard" or simply search for "Firewall and network protection" after you press the windows key). Within the Firewall and network protection page, you should see Domain network (if domain connected), Private network, Public network. Go for the private network an turn it off temporarily as a workaround. Hope this helps.
Reacted by Alberto Zugazagoitia, Serhii Rohoza, Ihor Klymenok, Laurent Gil, scriptswhisper and Thijs van Weezel
I may have found another way to fix this. Originally I had this problem after using a proxy software. I just edited resolv.conf. It worked well until I realized that I also couldn't ping to Windows from WSL.
For some reason, the vEthernet (WSL) adapter on my PC was treated as a public network. Disabling public firewall or turning off the option "block all incoming connections, including those in the list of allowed applications" in Control Panel fixed everything. I also attempted to change its connection profile to private using PowerShell, but Get-NetConnectionProfile can't even find it while both ipconfig and Get-NetIPconfiguration can display some limited info about it.
It might be to do with Windows Defender settings. resolv.conf and wsl.conf based approach didn't work for me. sudo apt update && sudo apt upgrade worked immediately after I turned off the Private network firewall. Once the update completed, I've put the firewall for private network back on.
On Windows 11, Go to Windows Security (from system tray, right click on Windows Security icon and select "View security dashboard" or simply search for "Firewall and network protection" after you press the windows key). Within the Firewall and network protection page, you should see Domain network (if domain connected), Private network, Public network. Go for the private network an turn it off temporarily as a workaround. Hope this helps.
This seems to be a fix for me too, Windows Firewall must be blocking DNS queries originating inside the WSL VM from reaching the DNS server at the host.
Reacted by kmoore999, Pieter, Ihor Klymenok, Diego Oliveira and muhammadnuralim
Tried to disable Windows Defender Firewall on Windows 10, doesn't help.
Tried manually editing /etc/resolv.conf in my Ubuntu 20.04 WSL2 by adding 8.8.8.8 and 1.1.1.1, it helps, but these servers don't work in our VPN.
What helped me as a workaround was adding my router's IP as a nameserver to resolv.conf since it has DNS server capability.
But I would like a more generalized solution.
Reacted by Khalil TABBAL, Dominik Mattioli, Adam Knirsch, oshawa-connection, Artūrs Bērziņš, scriptswhisper and fab
Windows 10 with Ubuntu 20 in WSL2 : got some reproducible failures today for the first time; and it's confirmed something I've suspected but never been able to prove.. that there might be a connection with running the docker daemon.
Everything is working correctly (as fas as DNS goes), start the docker daemon (just a plain sudo dockerd ) afterwards, the 'temporary failure' error occurs.
This appeared suddenly today, last time I tried (a few weeks ago) it had no such issues.
So just undo any changes you did to your setup during these few weeks.
I hadn't made any changes myself, I assume the changes came from some automatic updates to Windows settings. So I don't really know what changed.
It's not really a big deal for me as I can still connect through Windows' SSH. I just reported that this was an issue for me that's related to this thread.
This is just an FYI, I have worked around the issues and have things working (latest Windows 11 normal--non-insiders--channel).
With dnsTunneling=true (or not set as this is the default) in both NAT and mirrored network modes, nslookup github.com only succeeds for the first of the three queries it makes.
I suspect this is due to having DoH enabled on all my networks in the Windows host networking.
In order to disable dnsTuneling for mirrored network mode, one has to first set
networkMode=NAT
dnsTunneling=false
then do a wsl --shutdown, start wsl, and shut it down again, then set
networkMode=mirrored
dnsTunneling=false
Then the next time you start wsl the 10.255.255.254 address on the loopback will no longer be there. If you just skip to the dnsTunneling=false and networkMode=mirrored in one step the dns tunneling remains active and the 10.255.255.254 address is still present.
Hey, I also run into issues when using mirrored mode (dnsTunneling set to true or false), and switch wifi connections.
So far, seems like the only fix is to stick to NAT mode?
Any other possible fixes? Daniel F. Dickinson (@danielfdickinson) tried switching off dnsTunneling in two steps, but no luck
Also, DNS issues happen on my end with no VPN involved
Hi everyone, I've read all the comments briefly, so don't hate me if I miss something. I had a DNS problem with the local projects not being able to be resolved with the fake domain name.
So, in a nutshell, I have the following env.
WSL2 & LAMP stack on it. Then on Windows, I modify the hosts file like so: ::1 shipment.development localhost
It was working until some update, but then it stopped.
My temporary solution is the following:
Get the IP address of the wsl when I start it with this command: ip addr show eth0 | grep inet
Then I modify my hosts file on Windows like this: <the_wsl_ip_address> shipment.development
This works for me now, but if you have some other solution, I am all ears. By the way strange thing the previous hosts file modification works with some VPN enabled, but why, I don't know.
I didn't have time to check it more thoroughly, but when I get the chance, I will.
@0x4nud33p beware generateResolvConf is something you add to /etc/wsl.conf in the distro and not in .wslconfig. Also you shouldn't disable it if you are in Windows 11 and using DNS tunneling.
If you really need to configure .wslconfig I recommend the "WSL Settings" app that comes with latest version of WSL.
Fresh WSL install but can’t reach the internet, even though Windows networking works fine. I can ping from Windows successfully, but inside WSL all packets are lost.
PS C:\WINDOWS\system32> wsl --version
WSL version: 2.6.1.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.66
MSRDC version: 1.2.6353
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26200.6899
PS C:\WINDOWS\system32> wsl
anudeep@AsusVivobook16x:/mnt/c/WINDOWS/system32$ ping google.com
PING google.com (142.251.222.174) 56(84) bytes of data.
^C
--- google.com ping statistics ---
24 packets transmitted, 0 received, 100% packet loss, time 23548ms
anudeep@AsusVivobook16x:/mnt/c/WINDOWS/system32$ exit
logout
PS C:\WINDOWS\system32> ping google.com
Pinging google.com [2404:6800:4002:80e::200e] with 32 bytes of data:
Reply from 2404:6800:4002:80e::200e: time=75ms
Reply from 2404:6800:4002:80e::200e: time=75ms
Reply from 2404:6800:4002:80e::200e: time=78ms
Reply from 2404:6800:4002:80e::200e: time=84ms
Ping statistics for 2404:6800:4002:80e::200e:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 75ms, Maximum = 84ms, Average = 78ms
@0x4nud33p beware generateResolvConf is something you add to /etc/wsl.conf in the distro and not in .wslconfig. Also you shouldn't disable it if you are in Windows 11 and using DNS tunneling.
If you really need to configure .wslconfig I recommend the "WSL Settings" app that comes with latest version of WSL.
@0x4nud33p I see you have prioritized IPv6 on Windows. Inside WSL, does something like ping 142.251.222.174 work? What's the output for ifconfig?
I need you to go to Start menu and open the app "WSL Settings". In the Networking section make sure your networking mode is "Mirrored", you have enabled DNS tunneling and optionally DNS best effort parsing.
Remember to restart WSL with wsl.exe --shutdown to see the changes.
PS C:\Users\avula> ipconfig
Windows IP Configuration
Unknown adapter McAfee VPN:
Media State ...........: Media disconnected
Connection-specific DNS Suffix .:
Wireless LAN adapter Local Area Connection* 1:
Media State ...........: Media disconnected
Connection-specific DNS Suffix .:
Wireless LAN adapter Local Area Connection* 2:
Media State ...........: Media disconnected
Connection-specific DNS Suffix .:
Wireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix .:
IPv6 Address. ..........: 2409:40f0:dc:1ce6:b33c:17ec:4a8b:fe81
Temporary IPv6 Address. .....: 2409:40f0:dc:1ce6:4c20:b5ba:4082:6c75
Link-local IPv6 Address .....: fe80::c8da:3c9b:7a0c:160%8
Autoconfiguration IPv4 Address. .: 169.254.120.29
Subnet Mask ...........: 255.255.0.0
Default Gateway .........: fe80::d82a:2aff:fe82:f462%8
Ethernet adapter vEthernet (WSL (Hyper-V firewall)):
Connection-specific DNS Suffix .:
Link-local IPv6 Address .....: fe80::6cfd:c0f9:980a:a4f0%42
IPv4 Address. ..........: 172.22.128.1
Subnet Mask ...........: 255.255.240.0
Default Gateway .........:
PS C:\Users\avula>
PS C:\Users\avula> wsl.exe --shutdown
PS C:\Users\avula> ping google.com
Pinging google.com [2404:6800:4007:833::200e] with 32 bytes of data:
Reply from 2404:6800:4007:833::200e: time=40ms
Reply from 2404:6800:4007:833::200e: time=48ms
Reply from 2404:6800:4007:833::200e: time=39ms
Reply from 2404:6800:4007:833::200e: time=261ms
Ping statistics for 2404:6800:4007:833::200e:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip timesin milli-seconds:
Minimum = 39ms, Maximum = 261ms, Average = 97ms
PS C:\Users\avula> wsl
wsl: Invalid boolean value 'fasle'forkey 'network.generateResolvConf'in /etc/wsl.conf:2
anudeep@AsusVivobook16x:/mnt/c/Users/avula$ ping google.com
PING google.com (172.217.24.238) 56(84) bytes of data.
^X^C
--- google.com ping statistics ---
60 packets transmitted, 0 received, 100% packet loss, time 60420ms
anudeep@AsusVivobook16x:/mnt/c/Users/avula$
I do not have the “WSL Settings” app on my system I cannot access networking options through that app.
@0x4nud33p I see you have prioritized IPv6 on Windows. Inside WSL, does something like ping 142.251.222.174 work? What's the output for ifconfig?
I need you to go to Start menu and open the app "WSL Settings". In the Networking section make sure your networking mode is "Mirrored", you have enabled DNS tunneling and optionally DNS best effort parsing. Remember to restart WSL with wsl.exe --shutdown to see the changes.
It shows my WSL instance is using the default NAT networking mode, not mirrored.
I don’t have the “WSL Settings” app available on my system to change this mode through the UI.
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.
Activity
stijnherreman commentedon May 4, 2022
Blue (@OneBlue) I've posted repro steps in #8236 for one of the causes.
lbarbaglia commentedon May 10, 2022
Hi,
I'm having the exact same issue so I've collected some logs in case it can help:
WslLogs-2022-05-10_16-27-14.zip
Even modifying the /etc/resolv.conf is not working anymore.
CraigHutchinson commentedon May 17, 2022
I am getting this issue on fresh installation of Windows 11 with WSL2 Ubuntu image, really annoying issue!
[WSL]
sudo apt update=... Temporary failure resolving 'archive.ubuntu.com' ...[WSL]
cat /etc/resolv.conf=... nameserver 172.23.48.1[WSL]
ping 172.23.48.1=From 172.23.62.236 icmp_seq=3 Destination Host Unreachable[WSL]
ping google.com=ping: google.com: Temporary failure in name resolution[Windows]
ping 172.23.48.1=Reply from 172.23.48.1: bytes=32 time<1ms TTL=128Attached are the logs.
WslLogs-2022-05-17_10-17-13.zip
NOTE: ON Windows 11 I got this error when running the capture so they may be incomplete?

r2evans commentedon May 24, 2022
Craig Hutchinson (@CraigHutchinson) , your comment appears to mimic what I'm seeing, where the problem is somehow in the routing and not just the name resolution. Have you found any workarounds?
MikaelUmaN commentedon May 25, 2022
#4285 was already tracking this. I consider this issue the /dupe #4285
BtbN commentedon May 27, 2022
There were multiple open issues, all about the functionally same issue. Hence, as the initial description says, this exists to merge and declutter them.
dlaudams commentedon May 28, 2022
If this leads to a fix, this is a great outcome.
However the way it was handled may alienate the community. i.e., closing all the related issues without discussion or a clear reason provided in those issues.
unowiz commentedon May 29, 2022
It might be to do with Windows Defender settings. resolv.conf and wsl.conf based approach didn't work for me.
sudo apt update && sudo apt upgrade worked immediately after I turned off the Private network firewall. Once the update completed, I've put the firewall for private network back on.
On Windows 11, Go to Windows Security (from system tray, right click on Windows Security icon and select "View security dashboard" or simply search for "Firewall and network protection" after you press the windows key). Within the Firewall and network protection page, you should see Domain network (if domain connected), Private network, Public network. Go for the private network an turn it off temporarily as a workaround. Hope this helps.
Shellishack commentedon May 31, 2022
I may have found another way to fix this. Originally I had this problem after using a proxy software. I just edited resolv.conf. It worked well until I realized that I also couldn't ping to Windows from WSL.
For some reason, the vEthernet (WSL) adapter on my PC was treated as a public network. Disabling public firewall or turning off the option "block all incoming connections, including those in the list of allowed applications" in Control Panel fixed everything. I also attempted to change its connection profile to private using PowerShell, but
Get-NetConnectionProfilecan't even find it while bothipconfigandGet-NetIPconfigurationcan display some limited info about it.zugazagoitia commentedon Jun 2, 2022
This seems to be a fix for me too, Windows Firewall must be blocking DNS queries originating inside the WSL VM from reaching the DNS server at the host.
Ray-Barker commentedon Jun 3, 2022
Tried to disable Windows Defender Firewall on Windows 10, doesn't help.
Tried manually editing /etc/resolv.conf in my Ubuntu 20.04 WSL2 by adding 8.8.8.8 and 1.1.1.1, it helps, but these servers don't work in our VPN.
What helped me as a workaround was adding my router's IP as a nameserver to resolv.conf since it has DNS server capability.
But I would like a more generalized solution.
mbwhite commentedon Jun 8, 2022
Windows 10 with Ubuntu 20 in WSL2 : got some reproducible failures today for the first time; and it's confirmed something I've suspected but never been able to prove.. that there might be a connection with running the docker daemon.
Everything is working correctly (as fas as DNS goes), start the docker daemon (just a plain
sudo dockerd) afterwards, the 'temporary failure' error occurs.Logs attached.
WslLogs-2022-06-08_16-56-39.zip
jikuja commentedon Jun 14, 2022
For me #7555 gave really good pointers for fixing the issue.
Fixes that works for me:
I cannot recommend either of those to anyone because the first solution just breaks security and the second one might open some vulnerabilites.
93 remaining items
levzlotnik commentedon Jun 23, 2024
I hadn't made any changes myself, I assume the changes came from some automatic updates to Windows settings. So I don't really know what changed.
It's not really a big deal for me as I can still connect through Windows' SSH. I just reported that this was an issue for me that's related to this thread.
danielfdickinson commentedon Aug 11, 2024
This is just an FYI, I have worked around the issues and have things working (latest Windows 11 normal--non-insiders--channel).
dnsTunneling=true(or not set as this is the default) in both NAT and mirrored network modes,nslookup github.comonly succeeds for the first of the three queries it makes.then do a
wsl --shutdown, start wsl, and shut it down again, then setThen the next time you start wsl the
10.255.255.254address on the loopback will no longer be there. If you just skip to thednsTunneling=falseandnetworkMode=mirroredin one step the dns tunneling remains active and the10.255.255.254address is still present.HTH
OscBacon commentedon Nov 6, 2024
Hey, I also run into issues when using mirrored mode (dnsTunneling set to true or false), and switch wifi connections.
So far, seems like the only fix is to stick to NAT mode?
Any other possible fixes?
Daniel F. Dickinson (@danielfdickinson) tried switching off dnsTunneling in two steps, but no luck
Also, DNS issues happen on my end with no VPN involved
djordje47 commentedon May 12, 2025
Hi everyone, I've read all the comments briefly, so don't hate me if I miss something. I had a DNS problem with the local projects not being able to be resolved with the fake domain name.
So, in a nutshell, I have the following env.
WSL2 & LAMP stack on it. Then on Windows, I modify the hosts file like so:
::1 shipment.development localhostIt was working until some update, but then it stopped.
My temporary solution is the following:
ip addr show eth0 | grep inet<the_wsl_ip_address> shipment.developmentThis works for me now, but if you have some other solution, I am all ears. By the way strange thing the previous hosts file modification works with some VPN enabled, but why, I don't know.
I didn't have time to check it more thoroughly, but when I get the chance, I will.
Hope this helps someone, cheers!
anudeepx commentedon Oct 30, 2025
WSL2: Temporary failure in name resolution even after setting static DNS and disabling
generateResolvConfWhat I’ve tried
8.8.8.8and Windows gateway)Results
ping 8.8.8.8→ worksping google.com→ fails/etc/resolv.confis correct but ignored by WSL.wslconfigtriggers:Unknown key 'network.generateResolvConf' in C:\Users\avula\.wslconfigonomatopellan commentedon Oct 31, 2025
@0x4nud33p beware generateResolvConf is something you add to
/etc/wsl.confin the distro and not in .wslconfig. Also you shouldn't disable it if you are in Windows 11 and using DNS tunneling.If you really need to configure
.wslconfigI recommend the "WSL Settings" app that comes with latest version of WSL.anudeepx commentedon Oct 31, 2025
Fresh WSL install but can’t reach the internet, even though Windows networking works fine. I can ping from Windows successfully, but inside WSL all packets are lost.
onomatopellan commentedon Oct 31, 2025
@0x4nud33p I see you have prioritized IPv6 on Windows. Inside WSL, does something like
ping 142.251.222.174work? What's the output forifconfig?I need you to go to Start menu and open the app "WSL Settings". In the Networking section make sure your networking mode is "Mirrored", you have enabled DNS tunneling and optionally DNS best effort parsing.
Remember to restart WSL with
wsl.exe --shutdownto see the changes.anudeepx commentedon Oct 31, 2025
Jonathan (@onomatopellan)
I do not have the “WSL Settings” app on my system I cannot access networking options through that app.
onomatopellan commentedon Oct 31, 2025
@0x4nud33p You can get the networking mode from inside WSL with
wslinfo --networking-mode. Is itmirrored?anudeepx commentedon Oct 31, 2025
It shows my WSL instance is using the default NAT networking mode, not mirrored.
I don’t have the “WSL Settings” app available on my system to change this mode through the UI.
onomatopellan commentedon Oct 31, 2025
@0x4nud33p It's weird. it should be in
C:\Program Files\WSL\wslsettings\Anyway you need mirrored networking. In Windows 11 edit the
.wslconfigfile in the Users folder with this content:Then
wsl.exe --shutdownand try again.anudeepx commentedon Oct 31, 2025
It worked. Appreciate the guidance Jonathan (@onomatopellan)
microsoft-github-policy-service commentedon Nov 5, 2026
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!