[Bug] Issue with setting setAwaitDuration below 20 seconds in RocketMQ SimpleConsumer mode?

Before Creating the Bug Report

[X] I found a bug, not just asking a question, which should be created in GitHub Discussions.

[X] I have searched the GitHub Issues and GitHub Discussions  of this repository and believe that this is not a duplicate.

[X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment
Ubuntu 20.04
RocketMQ version
RocketMQ 5.2
JDK Version
JDK 17
Describe the Bug
Feedback for RocketMQ 5.2 version using SimpleConsumer mode:
I am encountering an issue when using the SimpleConsumer mode in RocketMQ version 5.2. Specifically, when I set the setAwaitDuration to a value less than 20 seconds, I receive the following error message:
Exception in thread "main" org.apache.rocketmq.client.java.exception.BadRequestException: [request-id=0bb55e31-e6ba-4539-8e23-296c6b35224f, response-code=40018] The deadline time remaining is not enough for polling, please check network condition

Here is the relevant Kotlin code snippet for reference:
val simpleConsumer = provider
    .newSimpleConsumerBuilder()
    .setClientConfiguration(clientConfiguration)
    .setConsumerGroup(consumerGroup)
    .setAwaitDuration(Duration.ofMillis(500)) // The issue occurs when this value is set below 20s
    .setSubscriptionExpressions(mapOf(topic to filterExpression))
    .build()

It seems that the error is related to the setAwaitDuration parameter needing to be greater than 20 seconds for proper functioning. However, I require more flexibility in setting this duration for my use case. Could you provide guidance on how to resolve this issue or suggest any workarounds that would allow me to set an AwaitDuration below 20 seconds without encountering this error?
Steps to Reproduce
Exception in thread "main" org.apache.rocketmq.client.java.exception.BadRequestException: [request-id=0bb55e31-e6ba-4539-8e23-296c6b35224f, response-code=40018] The deadline time remaining is not enough for polling, please check network condition
	at org.apache.rocketmq.client.java.exception.StatusChecker.check(StatusChecker.java:63)
	at org.apache.rocketmq.client.java.impl.consumer.ConsumerImpl.lambda$receiveMessage$0(ConsumerImpl.java:114)
	at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:221)
	at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:208)
	at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:122)
	at org.apache.rocketmq.shaded.com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
	at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1270)
	at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1038)
	at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:783)
	at org.apache.rocketmq.shaded.com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:49)
	at org.apache.rocketmq.client.java.rpc.RpcClientImpl$1.onCompleted(RpcClientImpl.java:168)
	at org.apache.rocketmq.shaded.io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:485)
	at org.apache.rocketmq.shaded.io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at org.apache.rocketmq.shaded.io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at org.apache.rocketmq.shaded.io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:563)
	at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
	at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:744)
	at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:723)
	at org.apache.rocketmq.shaded.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at org.apache.rocketmq.shaded.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

What Did You Expect to See?
Code can run well when setAwaitDuration  paramter < 20 seconds
What Did You See Instead?
No
Additional Context
No response

This exception indicates the pollingTime (awaitDuration) set by client is too small. There are two configs related to pollingtime in proxy, grpcClientConsumerMinLongPollingTimeoutMillis (default=5s) and grpcClientConsumerMaxLongPollingTimeoutMillis (default=20s).

This exception indicates the pollingTime (awaitDuration) set by client is too small.
There are two configs related to pollingtime in proxy, grpcClientConsumerMinLongPollingTimeoutMillis (default=5s) and grpcClientConsumerMaxLongPollingTimeoutMillis (default=20s). Set the pollingTime within this range would be ok.
Related proxy codes: develop/proxy/src/main/java/org/apache/rocketmq/proxy/grpc/v2/consumer/ReceiveMessageActivity.java#L82

thanks, I consulted the relevant documents and did not find this suggestion. The code comments also did not mention this problem. In order to better help subsequent users, would you consider improving the documentation?

Can you describe what scenario requires about setting setAwaitDuration below 20 seconds.

Can you describe what scenario requires about setting setAwaitDuration below 20 seconds.

In my understanding, the awaitDuration parameter allows me to fetch messages more promptly. During periods of low business activity, when a particular message is highly important yet the number of such messages may fall short of the maxMessageNum threshold (which stems from the org.apache.rocketmq.client.apis.consumer.SimpleConsumer#receive(maxMessageNum, duration) call), this parameter ensures a swift return nonetheless.


ENYO-5764: Fix VideoPlayer to continue to show thumbnail on playback keypress

Checklist

[ ] I have read and understand the contribution guide

[ ] A CHANGELOG entry is included

[ ] At least one test case is included for this feature or bug fix

[ ] Documentation was added or is not needed

[ ] This is an API breaking change

Issue Resolved / Feature Added
When hovering the slider to show the thumbnail, pressing playback keys (play/pause) would hide the thumbnail.
Resolution
Remove the state update in showFeedback to feedbackAction and instead rely on the other existing triggers (hideFeedback, hideControls).
Additional Considerations
This feature was added by #1798. I've checked this against that bug report and didn't notice a regression. cc: @viodragon2 in case you recall specifics on why this code was added originally.

I don't remember exactly why I added this specific part, but my guess is feedbackAction needed to be reset. feedbackAction is not in focus state anymore whenever showFeedback is called in most cases. Feedbacks are shown when actions (e.g. play, pause, rew, ff, etc.) are registered. It's possible that this was an oversight for this specific use case where the action happens while retaining focus. I think this change is okay 👍


Replace c-style casts & fix implicit conversion warnings in DRM code

[x] Has this change been discussed on the forum or in an issue before?
[x] Does the code follow the SFML Code Style Guide?
[ ] Have you provided some example/test code for your changes?
[ ] If you have additional steps which need to be performed list them as tasks!

Description
Replaces c-style casts with c++ cast operators and fixes "implicit conversion changes singedness" warnings.
This PR is related to the issue #2297
Tasks

[x] Tested on Linux
[ ] Tested on Windows
[ ] Tested on macOS
[ ] Tested on iOS
[ ] Tested on Android

SFMLBuildMaster: Build this please.

SFMLBuildMaster: Build this please.


Colin/general cleanup

Give an overview of the tasks completed
Just cleaning up throughout the codebase. Made some changes that I am not married to. Please review!
Closes #585

Can this close #585?

Yes


WSL2 - No internet connectivity. DNS Issues(Temporary failure in name resolution)

Environment
Windows build number: Version 10.0.18363.1256
Your Distribution version: Both Ubuntu 18.04 and Ubuntu 20.04
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Steps to reproduce
Install WSL2 with any Ubuntu distro(1804/2004) .Ping google.com or any other website. Tried on with/without VPN(Big Edge IP client).

 Done
Building dependency tree
Reading state information... Done
All packages are up to date.
 They have been ignored, or old ones used instead.
Expected behavior
I should get reply to the ping. And Internet should be easily accessible from within WSL.
WSL 1 has no problem. I am able to connect to internet. When I try to use docker on WSL , it asks to upgrade to WSL2. So now i have no option. Just have to use WSL2 for docker where there is no internet connectivity

Actual behavior

Have looked at the solutions from other  issues. None seems to works. Follows some that I have tried but it seems not to work.

Added ([network]generateResolvConf = false) to wsl.conf  And add nameserver <IP_ADDRESS> in  resolv.conf

Run the following powershell script

`echo "Restarting WSL Service"
Restart-Service LxssManager
echo "Restarting Host Network Service"
Stop-Service -name "hns"
Start-Service -name "hns"
echo "Restarting Hyper-V adapters"
Get-NetAdapter -IncludeHidden | Where-Object `
    {$_.InterfaceD```
escription.StartsWith('Hyper-V Virtual Switch Extension Adapter')} `
    | Disable-NetAdapter -Confirm:$False
Get-NetAdapter -IncludeHidden | Where-Object `
    {$_.InterfaceDescription.StartsWith('Hyper-V Virtual Switch Extension Adapter')} `
    | Enable-NetAdapter -Confirm:$False`

Please let me know how can i fix this issue, so i can connect to internet from my WSL
FYI Antivirus - McAffe and Windows Defender is enabled.

Elementary Watson! All WSL distro are derived from the corresponding Cloud VM distros. These distros are systemd based Linux distros. The Network Manager is responsible  for network configuration and every infrastructure provides the hook that configures the resolv.conf:
cat /etc/NetworkManager/dispatcher.d/hook-network-manager
#!/bin/sh
This file is part of cloud-init. See LICENSE file for license information.
This script hooks into NetworkManager(8) via its scripts
arguments are 'interface-name' and 'action'

is_azure() {
local dmi_path="/sys/class/dmi/id/board_vendor" vendor=""
if [ -e "$dmi_path" ] && read vendor < "$dmi_path"; then
[ "$vendor" = "Microsoft Corporation" ] && return 0
fi
return 1
}
is_enabled() {
# only execute hooks if cloud-init is enabled and on azure
[ -e /run/cloud-init/enabled ] || return 1
is_azure
}
if is_enabled; then
case "$1:$2" in
*:up) exec cloud-init dhclient-hook up "$1";;
*:down) exec cloud-init dhclient-hook down "$1";;
esac
fi
All this mechanism heavily relies on systemd-resolved daemon.
Without this initialization process /etc/resolv.conf is only a symbolic link pointing  to /run/systemd/resolve/stub-resolv.conf created during distro installation:
No DNS servers known.
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 <IP_ADDRESS>
With generateResolvConf = false your nameserver is always <IP_ADDRESS>
With generateResolvConf = true your nameserver can't be correctly detected without systemd-resolved daemon.
You can either add GoogleDNS 88.8.8 as a nameserver in the 1st position
or if you use "smart" WiFi router or team router with built-in DNS and DNS forwarding feature IP address of your router, <IP_ADDRESS> for example.

Elementary Watson! All WSL distro are derived from the corresponding Cloud VM distros. These distros are systemd based Linux distros. The Network Manager is responsible  for network configuration and every infrastructure provides the hook that configures the resolv.conf:
cat /etc/NetworkManager/dispatcher.d/hook-network-manager
#!/bin/sh
This file is part of cloud-init. See LICENSE file for license information.
This script hooks into NetworkManager(8) via its scripts
arguments are 'interface-name' and 'action'

is_azure() {
local dmi_path="/sys/class/dmi/id/board_vendor" vendor=""
if [ -e "$dmi_path" ] && read vendor < "$dmi_path"; then
[ "$vendor" = "Microsoft Corporation" ] && return 0
fi
return 1
}
is_enabled() {
# only execute hooks if cloud-init is enabled and on azure
[ -e /run/cloud-init/enabled ] || return 1
is_azure
}
if is_enabled; then
case "$1:$2" in
*:up) exec cloud-init dhclient-hook up "$1";;
*:down) exec cloud-init dhclient-hook down "$1";;
esac
fi
All this mechanism heavily relies on systemd-resolved daemon.
Without this initialization process /etc/resolv.conf is only a symbolic link pointing  to /run/systemd/resolve/stub-resolv.conf created during distro installation:
No DNS servers known.
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 <IP_ADDRESS>
With generateResolvConf = false your nameserver is always <IP_ADDRESS>
With generateResolvConf = true your nameserver can't be correctly detected without systemd-resolved daemon.
You can either add GoogleDNS 88.8.8 as a nameserver in the 1st position
or if you use "smart" WiFi router or team router with built-in DNS and DNS forwarding feature IP address of your router, <IP_ADDRESS> for example.

With generateResolvConf = false your nameserver is always <IP_ADDRESS>
With generateResolvConf = true your nameserver can't be correctly detected without systemd-resolved daemon.
You can either add GoogleDNS 88.8.8 as a nameserver in the 1st position
or if you use "smart" WiFi router or team router with built-in DNS and DNS forwarding feature IP address of your router, <IP_ADDRESS> for example.

I have tried all this but no luck. I still see the same issue

With generateResolvConf = false your nameserver is always <IP_ADDRESS>
With generateResolvConf = true your nameserver can't be correctly detected without systemd-resolved daemon.
You can either add GoogleDNS 88.8.8 as a nameserver in the 1st position
or if you use "smart" WiFi router or team router with built-in DNS and DNS forwarding feature IP address of your router, <IP_ADDRESS> for example.

I have tried all this but no luck. I still see the same issue

Every time when WSL terminal is opened WSL generates the resolv.conf regardless of how it is configured in wsl.conf. The wsl.conf is only the link to the "real" resolv.conf file generated normally bi the systemd-resolved daemon. This is documented for such Linux distro as Ubuntu. Suse, CentOS, Debian. See for example systemd-resolved Suse and systemd-resolved Debian.
What does it mean "# Enable DNS – even though these are turned on by default, we'll specify here just to be explicit.
[network]
generateResolvConf = false" in wsl.conf if in WSL2 VM this is not a file but a symbolic link pointing to the file generated by the dedicated daemon? Is it a rudiment of WSL 1?
Why WSL 2 tries to generate the resolv.conf file if  it can't do it correctly due to lack of "official" systemd?
I run WSL2 Ubuntu distro with genie and use systemd. But WSL revenges me and destroys Linux networking.

Every time when WSL terminal is opened WSL generates the resolv.conf regardless of how it is configured in wsl.conf. The wsl.conf is only the link to the "real" resolv.conf file generated normally bi the systemd-resolved daemon. This is documented for such Linux distro as Ubuntu. Suse, CentOS, Debian. See for example systemd-resolved Suse and systemd-resolved Debian.
What does it mean "# Enable DNS – even though these are turned on by default, we'll specify here just to be explicit.
[network]
generateResolvConf = false" in wsl.conf if in WSL2 VM this is not a file but a symbolic link pointing to the file generated by the dedicated daemon? Is it a rudiment of WSL 1?
Why WSL 2 tries to generate the resolv.conf file if  it can't do it correctly due to lack of "official" systemd?
I run WSL2 Ubuntu distro with genie and use systemd. But WSL revenges me and destroys Linux networking.

After the last update of windows few days ago (Insider Preview build 21292.1010 ) I got the dns issue inside wsl.
a long time ago (more than 1 year ago), for the same kind of issue, I had to update the content of /etc/wsl.conf with the following.
[network]
generateResolvConf = false

I Just tried to put it at true, and it fixed the issue.
But not sure it's really something we want, to have a resolv.conf generated.

After the last update of windows few days ago (Insider Preview build 21292.1010 ) I got the dns issue inside wsl.
a long time ago (more than 1 year ago), for the same kind of issue, I had to update the content of /etc/wsl.conf with the following.
[network]
generateResolvConf = false

I Just tried to put it at true, and it fixed the issue.
But not sure it's really something we want, to have a resolv.conf generated.

+1 With Windows 10 Insiders build 21292 (and the previous build when the issue started) WSL2 fails DNS lookups regardless of wsl.conf and resolv.conf manipulations. (This appears to be the same problem as when this happened for a few builds last year.)

+1 With Windows 10 Insiders build 21292 (and the previous build when the issue started) WSL2 fails DNS lookups regardless of wsl.conf and resolv.conf manipulations. (This appears to be the same problem as when this happened for a few builds last year.)

Also got this issue from the recent 1010 update.

Also got this issue from the recent 1010 update.

I run Windows 10 Pro Insider preview build 212921010
I am afraid that resolv.conf generation for WSL is too much simplified to work in the complex networking environment. I looked into the Linux log what Linux resolve daemon does in Linux: it checks Network interface statuses and route ability before pushing something into the file on which /etc/resolv link points. It is not helpful to use DNS that is not reachable itself. DNS itself must be functional. It allows multiple nameservers via multiple interfaces. etc. It doesn't assume that the computer is attached to the Internet Laptop can be connected to the different WiFi networks managed by different providers. Also, preferable DNS is different.
Every time when Driver emits a status event daemon has to manipulate with DNS list.
In my default distro Ubuntu 20.10
I use the "static" DNS address <IP_ADDRESS> because if I can't reach my router I can't reach DNS and any other site.
Inside my router, I have both Dynamic DNS and DNS forwarding enabled. It helps because the router has its own IPV6 DHCP WAN address gotten from ISP
My preferable DNS is ping dns9.quad9.net
PING dns9.quad9.net (<IP_ADDRESS>) 56(84) bytes of data.
64 bytes from dns9.quad9.net (<IP_ADDRESS>): icmp_seq=1 ttl=54 time=20.5 ms
64 bytes from dns9.quad9.net (<IP_ADDRESS>): icmp_seq=2 ttl=54 time=13.1 ms
and not my ISP or Google:
ping dns.google
PING dns.google (<IP_ADDRESS>) 56(84) bytes of data.
64 bytes from dns.google (<IP_ADDRESS>): icmp_seq=1 ttl=113 time=72.3 ms
and not DNS got from my ISP
ping <IP_ADDRESS>
PING <IP_ADDRESS> (<IP_ADDRESS>) 56(84) bytes of data.
--- <IP_ADDRESS> ping statistics ---
14 packets transmitted, 0 received, 100% packet loss, time 13558ms
It works stably because I trust in the Router's OpenWRT DNS logic and bypass all suspicious or unstable DNS addresses.

I run Windows 10 Pro Insider preview build 212921010
I am afraid that resolv.conf generation for WSL is too much simplified to work in the complex networking environment. I looked into the Linux log what Linux resolve daemon does in Linux: it checks Network interface statuses and route ability before pushing something into the file on which /etc/resolv link points. It is not helpful to use DNS that is not reachable itself. DNS itself must be functional. It allows multiple nameservers via multiple interfaces. etc. It doesn't assume that the computer is attached to the Internet Laptop can be connected to the different WiFi networks managed by different providers. Also, preferable DNS is different.
Every time when Driver emits a status event daemon has to manipulate with DNS list.
In my default distro Ubuntu 20.10
I use the "static" DNS address <IP_ADDRESS> because if I can't reach my router I can't reach DNS and any other site.
Inside my router, I have both Dynamic DNS and DNS forwarding enabled. It helps because the router has its own IPV6 DHCP WAN address gotten from ISP
My preferable DNS is ping dns9.quad9.net
PING dns9.quad9.net (<IP_ADDRESS>) 56(84) bytes of data.
64 bytes from dns9.quad9.net (<IP_ADDRESS>): icmp_seq=1 ttl=54 time=20.5 ms
64 bytes from dns9.quad9.net (<IP_ADDRESS>): icmp_seq=2 ttl=54 time=13.1 ms
and not my ISP or Google:
ping dns.google
PING dns.google (<IP_ADDRESS>) 56(84) bytes of data.
64 bytes from dns.google (<IP_ADDRESS>): icmp_seq=1 ttl=113 time=72.3 ms
and not DNS got from my ISP
ping <IP_ADDRESS>
PING <IP_ADDRESS> (<IP_ADDRESS>) 56(84) bytes of data.
--- <IP_ADDRESS> ping statistics ---
14 packets transmitted, 0 received, 100% packet loss, time 13558ms
It works stably because I trust in the Router's OpenWRT DNS logic and bypass all suspicious or unstable DNS addresses.

After the last update of windows few days ago (Insider Preview build 21292.1010 ) I got the dns issue inside wsl.
a long time ago (more than 1 year ago), for the same kind of issue, I had to update the content of /etc/wsl.conf with the following.
[network]
generateResolvConf = false

I Just tried to put it at true, and it fixed the issue.
But not sure it's really something we want, to have a resolv.conf generated.

I didn't see this reply. I did this and it also fixed my recent issue.

After the last update of windows few days ago (Insider Preview build 21292.1010 ) I got the dns issue inside wsl.
a long time ago (more than 1 year ago), for the same kind of issue, I had to update the content of /etc/wsl.conf with the following.
[network]
generateResolvConf = false

I Just tried to put it at true, and it fixed the issue.
But not sure it's really something we want, to have a resolv.conf generated.

I didn't see this reply. I did this and it also fixed my recent issue.

Resolv.conf generation in the current implementation is a useless and harmful feature in the most cases. Even Chrome knows to test DNS availability 1st according to "DNS PROBE ERROR" appears in the case of connectivity issues. Google shows a long list of The "best DNS determination" tools. The correct DNS selection depends on the status of network interfaces and how the host is connected to the global internet infrastructure.   Also, DNS protocol can vary from UDP to HTTPS. The best choice is always the DNS that is connected to the LAN itself. IT is 99.9% available and can be easily rebooted. Its status can be easily tested using nslookup <IP_ADDRESS> - must return name = dns.google .

Resolv.conf generation in the current implementation is a useless and harmful feature in the most cases. Even Chrome knows to test DNS availability 1st according to "DNS PROBE ERROR" appears in the case of connectivity issues. Google shows a long list of The "best DNS determination" tools. The correct DNS selection depends on the status of network interfaces and how the host is connected to the global internet infrastructure.   Also, DNS protocol can vary from UDP to HTTPS. The best choice is always the DNS that is connected to the LAN itself. IT is 99.9% available and can be easily rebooted. Its status can be easily tested using nslookup <IP_ADDRESS> - must return name = dns.google .

Thanks for reporting the issue  @devshashankb .
Can you please follow these instructions and share the script output, and both wsl.etl and packets.etl ?

Thanks for reporting the issue  @devshashankb .
Can you please follow these instructions and share the script output, and both wsl.etl and packets.etl ?

I have this issue happened recently too .
Edit /etc/wsl.conf with
[network]
generateResolvConf = false

and change /etc/resolve.conf doesn't solve my problem .

"Temporary failure in name resolution" looks like a message coming from DNS client or server.
If ifconfig -a, ip -a in Ubuntu shows nothing then the networking doesn't work at all and configured in resolv.conf DNS is not reachable. But if you can look at ls a- /etc/resolv.conf - and cat /etc/resolv.conf output and check that the /etc/resolv.conf is a link and you can ping the 1st nameserver in the resolv.conf you can save your time. The DNS must be accessible via VM's eth0 interface and be usable. To test the DNS you can try nsllookup your-site-url your-configured-DNS from the Windows command line.
P.S. There is no reason to trust in your ISP DNS. There are many alternative DynDNS providers with better maintenance, performance, and security starting from 8.8..8.8.

@devshashankb I am afraid you are 100% correct and WSL team is 100% not :(. In the recent and most useful Linux distros DNS resolution is so tightly coupled with systemd mechanism, resolved service, and dbus service that any alternative solution is not possible. The provided by Debian, Ubuntu, and Fedora distro lines services are perfectly tuned to the modern networking and cloud computing environment. The old Windows-like solution has stopped working without mitigation using Router configuration that enables DynDNS and other than UDP protocols usage.
I start my most useful distros Ubuntu 20.10 and Fedora 33 with systemd support and have
In Ubuntu:
$ systemd-resolve <IP_ADDRESS>
<IP_ADDRESS>: dns9.quad9.net
In Fedora - similar
systemd-resolve <IP_ADDRESS>
<IP_ADDRESS>: dns9.quad9.net                        -- link: eth0
-- Information acquired via protocol DNS in 12.8ms.
-- Data is authenticated: no
But my /etc/resolv.conf link is overridden every wsl "login". I have to re-create it manually every time. Otherwise, these systemd based Linux distros can't access the internet, i.e cloud services, repositories,etc. deployed globally Every attempt to resolve DNS names using "old static DNS servers" results in a "temporary" DNS resolution error, as expected.

Hey, I succeeded to run systemd-resolved service manually and it found 3 critical issues:

Not all protocols used in DNS resolution are passed from WSL VM to the probed DNS server. But this is OK. resolved knows how to recover.
Generated /etc/hosts file contained invalid character in the line 7 - it affects local routers communication for the address starting from 192.
/etc/resolv.conf is re-created every distro start. Since /etc/resolv.conf "created manually" has the highest priority I have to remove it every time.
Everything else works OK and provides optimized DNS resolution.

After a few weeks of experience with the real-world Linux distro used as a WSL image that managed by systemd, I found that if the original distro was systemd-based then all games with /etc/resolv.conf affect nothing. Every program built with the networking libraries for these distro establishes IPC connection with systemd-resolve using D-Bus and the DNS resolver daemon solves for the "client" program all issues related to DNS using its own configuration: interface to communicate with DNS, protocol, possible delegation to the globally deployed dDNS service, etc. Everything works because the modern Internet infrastructure is virtually unbreakable. When I run OCI containers in my distro the running container gets the correct resolv.conf content as magic.

I didn't even know we could run other distrib than the one given by the store.
I will try it.
a bit out of the subject, @PavelSosin-320  did you find some pro and con (apart of the network ) to use a real-world Linux distro

All WSL distros published in the Microsoft store are plain so-called
initrd distros, i.e. distros with read-only compressed into single file
root fs that is used for 1st-time boot. There is nothing new in it. I think
all Linux distro can be started from USB, CD, or Network. To install any
Linux distro you need either some rootfs ext4 file of the corresponding
distro or tar file of some existing distro exported by another developer to
be imported and registered as in Export and import WSL distro
https://docs.microsoft.com/en-us/windows/wsl/reference Both things are no
so rare asset - use google or Linux community sites.
If you use the 1st method you have to open regedit and copy/paste/edit the
set of entries like for already existing distro.
under Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss
. If you use the 2nd method you can simply use wsl --import to create
distro FS in the desired location with the desired name from the tar file.
Pros:

Both methods work unlike installation from Microsoft store that results
in died distro fo 20$.
You have more freedom in the Distro name and rootfs location.
You have the real support from the Software house maintaining the distro
instead of opening issues for WSL and waiting 6 months until somebody will
read it.
4 You can upgrade your distro from the original distro repositories
whenever you want without saying "Sorry, I need to upgrade and change the
initialization method of my distro to systemd. Why I have the same issues
as in the original distro from MS Store and nobody care to correct the
image in the MS Store.

On Fri, Feb 19, 2021 at 4:29 AM Ludovic<EMAIL_ADDRESS>wrote:

I didn't even know we could run other distrib than the one given by the
store.
I will try it.
a bit out of the subject, @PavelSosin-320
https://github.com/PavelSosin-320 did you find some pro and con (apart
of the network ) to use a real-world Linux distro
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/WSL/issues/6404#issuecomment-781770679, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AM7YVKD7VPSL7JHI7J5GNCDS7XEIZANCNFSM4VWVOLUQ
.

Is there a chance that you are getting the DNS resolution error, while on a VPN?
Because this is exactly the same problem I am having for some months now and because I dont have admin rights on my working maschine I am not able to make it work.
It have been 4-5 months now without using my WSL2 on a VPN.

Some reaction from Microsoft?
WSL ignores
[network]
generateResolvConf = false
and generates resolv.conf containing wrong nameserver IP address. The generated IP is that the ISP provides via Network bridge ( modem or combo ). If the local network is managed by a router the correct primary nameserver must be the IP of the Router's nameserver that configured in the router, VPN-provided DNS or Corporate DNS depends on Networking scenario in the LAN .In many cases, this DNS is the least stable of all available. My luck is that I run WSL distros with systemd and resolve daemon and in this scenario /etc/resolv.conf is only a link to the generated by resolve daemon stub. In systemd-based Linux distros /etc/resolv.conf is not the primary nameserver source. The nameserver value in the WSL generated resolv.conf is silently ignored and everything works like swiss watch.

[network]
generateResolvConf = false

You have to change  sudo nano /etc/wsl.conf.
[network]
generateResolvConf = false

After that go to sudo nano /etc/resolv.conf delete everything there and put your desired nameservers there:
nameserver <IP_ADDRESS>

After that in Powershell type wsl --shutdown.
Now your resolv.conf will be the same.

@K2ouMais
I did exactly that. Although WSL2 won't generate /etc/resolv.conf anymore, WSL2 deletes the file every time when I restart it (so no nameserver at all). Do you happen to know what is happening? Thanks in advance.

Edition	Windows 10 Home Insider Preview
Version	Dev
OS build	21322.1000

It deletes the file? That never happened to me.
It must be something else you have setup, to that to happen.

Ok try this solution (it works for me) :
Create /etc/wsl.conf as explained before with that :
[network] generateResolvConf = false
1 . Rename link /etc/resolv.conf :
> sudo mv /etc/resolv.conf  /etc/resolv.conf.old
Create and edit new resolv.conf file (not a link) :
> sudo vi /etc/resolv.conf
and just add this line (indicate your livebox gateway address / (orange for me)) :
nameserver <IP_ADDRESS>
Don't forget to change authorization :
> sudo chmod 777 /etc/resol.conf

I'm working with WSL2 and Ubuntu 20.04LTS
Ok try this solution (it works for me) :
Create /etc/wsl.conf as explained before with that :
[network]
generateResolvConf = **false**

1 . Rename link /etc/resolv.conf :
> sudo mv /etc/resolv.conf /etc/resolv.conf.old
2 . Create and edit new resolv.conf file (not a link) :
> sudo vi /etc/resolv.conf
and just add this line (indicate your livebox gateway address / (orange for me)) :
nameserver <IP_ADDRESS>
3 . Don't forget to change authorization :
> sudo chmod 777 /etc/resolv.conf
You should see that :

4 . close console and reopen it. just type :
exit
5 . Try to update linux (sudo apt update) to check network connection and .... it works well (not before procedure).
I hope enjoy for you too !
Edition Windows 10 Professional 20H2
Insider - Canal release preview
OS build 19042.844

I tried this unforunately it doesn't work for me

Ubuntu, CentOS, Fedora,Suse are systemd-based distros today. Most of utilities and applications are written in assumption that the distro is booted by systemd, NetworkManager and Resolved services have done their job and serve everybody via D-Bus. The /etc/resolv.conf link only points to resolv.conf stub and the content of /etc/resolv is not so important, Configuration of NM and Resolved consists of dozens of lines and allows to config networking in the very complex setups. /etc/resolv.conf allows to configure network only if the computer is attached to the wall using a basic modem. But it is relikt setup today. What do you expect?

How it works in my setup with genie and systemd:

Wakeup the machine WiFi using ping from the Command prompt -  WSL doesn't do it alone. You can wait forever.
Follow Check Linux network interface status
Check that Network is ready
systemctl status systemd-networkd
● systemd-networkd.service - Network Service
Loaded: loaded (/usr/lib/systemd/system/systemd-n
etworkd.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-03-09 08:18:55 IST; 12min ago
TriggeredBy: ● systemd-networkd.socket
Docs: man:systemd-networkd.service(8)
Main PID: 24 (systemd-network)
Status: "Processing requests..."
Tasks: 1 (limit: 14367)
Memory: 3.2M
CGroup: /system.slice/systemd-networkd.service
└─24 /usr/lib/systemd/systemd-networkd
Check that you are connected in the log
systemctl status systemd-networkd
● systemd-networkd.service - Network Service
Loaded: loaded (/usr/lib/systemd/system/systemd-n
etworkd.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2021-03-09 08:18:55 IST; 12min ago
TriggeredBy: ● systemd-networkd.socket
Docs: man:systemd-networkd.service(8)
Main PID: 24 (systemd-network)
Status: "Processing requests..."
Tasks: 1 (limit: 14367)
Memory: 3.2M
CGroup: /system.slice/systemd-networkd.service
└─24 /usr/lib/systemd/systemd-networkd

Mar 09 08:18:55 MSI-wsl systemd-networkd[24]: /usr/lib/systemd/network/80-container-ve.network:23: IPMasquerade=yes is deprecated, and
it is handled as "ipv4" instead of "both". Please use "ipv4" or "both".
Mar 09 08:18:55 MSI-wsl systemd-networkd[24]: /usr/lib/systemd/network/80-container-vz.network:22: IPMasquerade=yes is deprecated, and
it is handled as "ipv4" instead of "both". Please use "ipv4" or "both".
Mar 09 08:18:55 MSI-wsl systemd-networkd[24]: /usr/lib/systemd/network/80-vm-vt.network:22: IPMasquerade=yes is deprecated, and it is handled
as "ipv4" instead of "both". Please use "ipv4" or "both".
Mar 09 08:18:55 MSI-wsl systemd-networkd[24]: eth0: Gained IPv6LL
Mar 09 08:18:55 MSI-wsl systemd-networkd[24]: Enumeration completed
Mar 09 08:18:55 MSI-wsl systemd[1]: Started Network Service.
Mar 09 08:20:19 MSI-wsl systemd-networkd[24]: eth0: Lost carrier
Mar 09 08:20:23 MSI-wsl systemd-networkd[24]: eth0: Gained carrier
Mar 09 08:20:28 MSI-wsl systemd-networkd[24]: eth0: Lost carrier
Mar 09 08:20:30 MSI-wsl systemd-networkd[24]: eth0: Gained carrier
If the last record says "eth0: Gained network you are OK.

If somebody still has DNS resolution issues than open \wsl\Fedora34\etc\systemd\resolved.conf file using any editor that preserves  Linux EOL, read documentation inside (5 min), and configure DNS resolution according to guidelines and his/her desire.

@margarineHound FYI: I'm running the same setup (WSL 2, Ubuntu-20.04) and after every system restart, only the very first time I open a shell  I run sudo cp /etc/resolv.conf.manual /etc/resolv.conf, to replace the nameserver config with the one I keep, that is already configured with my known working preferred nameservers. That's it.  At least for me, it eliminates the extra steps.

We were running into this DNS issue with Cisco AnyConnect only while on VPN like some people on this issue mentioned. Solution was really simple: open 'Advanced Window' on Cisco AnyConnect Secure Mobile Client and click "Allow local (LAN) access when VPN (if configured)". Restart VPN and DNS starts working again.

We were running into this DNS issue with Cisco AnyConnect only while on VPN like some people on this issue mentioned. Solution was really simple: open 'Advanced Window' on Cisco AnyConnect Secure Mobile Client and click "Allow local (LAN) access when VPN (if configured)". Restart VPN and DNS starts working again.

I have no option named like that on my corporate AnyConnect VPN :/

wsl2 dns starts to feel like russian roulette. i'm not behind any vpn. just a super basic WSL2 + ubuntu LTS.
after being completely broken pre 20H, i'm now on 20H2 (19042.928) and its broken again. no matter what workaround i try. 😫
my hate for my macbook slowly moves to my surface laptop, every single time I lose a day at work because of these wsl2 issues...
i cant believe we still struggle with this after months.

@kitsunekyo It doesn't look like "Russian roulette". It doesn't work correctly in a stable manner: It assumes that the only available and best DNS service is the ISP provided or GoogleDNS. This is a false assumption today:   DNS proxy or service can run on the Local network. ISP DNS can be in maintenance today, unstable, poorly synchronized, or simply uses old software, i.e. "Static"  and can't resolve Cloud services DNS names, or doesn't support all DNS protocols. The best global DNS service instance can run in the DataCenter just a few kilometers from the laptop or accessible via 1GB infrastructure.
Linux OS like Chrome browser assumes that the "What is my DNS?" question has up to 4 answers.
In the systemd-based distro, standard libraries use resolved service to ask for name resolution via D-Bus socket.  Resolved.conf is used instead of /etc/resolv.conf.

wsl2 dns starts to feel like russian roulette. i'm not behind any vpn. just a super basic WSL2 + ubuntu LTS.
after being completely broken pre 20H, i'm now on 20H2 (19042.928) and its broken again. no matter what workaround i try. 😫
my hate for my macbook slowly moves to my surface laptop, every single time I lose a day at work because of these wsl2 issues...
i cant believe we still struggle with this after months.

Welcome to the WSL2 mess party. 🎉

@K2ouMais WSL apology: WSL is not bad. The networking initialization by the WSL init is the real problem. If you run a systemd-based distro like Ubuntu, Debian, Fedora, etc. using systemd boot using any anti-WSL V1 workaround like systemd-genie, you can configure your distro's networking as regular Linux networking using Linux documentation and common sense, disable resolv.conf generation and achieve 100% networking stability. Some network landscape measurement and configuration optimization will bust name resolution speed up to 100 times.

@PavelSosin-320 I don't want to say that WSL is bad, but it has some connectivity problems for some months now.
Personally I can't use WSL2 on the company VPN, but I am seeing people having the exact same problem on their local network.
I tried every possible workaround found here all over the issues without success.
Yes, I also tried changing the resolv.conf and so on, but it doesn't work for me.
Bad is, WSL2 is my choice when developing and right now there are some ugly ways to fix this problem.
Reverting to WSL1 is a way to fix the connectivity problems. But I loose a way to use docker.
The other solution is using docker's vpn-kit, but that relys in having a terminal window open all the time, running an app.
I even tried other obscure fixes and they also don't work at all.
WSL2 is amazing and I don't want to miss it, but Microsoft seems to not care about these problems at all.

@K2ouMais There are several Dockerless options to run OCI containers. Some of them, like Podman are very Development-focused. Docker-for-win is useless as a production server anyway. It has only one benefit - a kind of Kubernetes stack. Docker-for-win close coupling with WSL 2 makes it unstable like WSL 2. I've stopped using it.

@PavelSosin-320 in the end it doesn't matter. If my working place wants me to use docker for windows I have to use it. It isn't my decision and I have no choice.

We were running into this DNS issue with Cisco AnyConnect only while on VPN like some people on this issue mentioned. Solution was really simple: open 'Advanced Window' on Cisco AnyConnect Secure Mobile Client and click "Allow local (LAN) access when VPN (if configured)". Restart VPN and DNS starts working again.

I have no option named like that on my corporate AnyConnect VPN :/

Also tried every solution around the web, setting up the /etc/resolv.conf with my VPN interface DNS settings didn't help;
Now, I am trying to use Cntlm as a proxy for my WSL2 instance, but I can't manage to make it work...
I managed to make work docker (based on Hyper-V) with the proxy settings from Cntlm setup; however from WSL2 it seems like I can't access my local network or something...

I tried this solution but it didn't work. I have since reverted back to WSL1

Did somebody check that DNS server is accessible by itself before trying to
resolve names? If ping from the Linux distro shell to DNS IP doesn't work
VPN client blocks access to DNS forever and not "Temporary".  The
common-sense assumption is that VPN provider has its own DNS service and
its IP must be pingable. Never try your ISP DNS - it is certainly insecure.
For the more detailed investigation, Linux has dig utility that allows
finding the answer  : linux-dig-command-examples
https://phoenixnap.com/kb/linux-dig-command-examples on the question "Why
DNS resolution doesn't work for me?"
On Thu, May 20, 2021 at 5:36 AM margarineHound @.***>
wrote:

We were running into this DNS issue with Cisco AnyConnect only while on
VPN like some people on this issue mentioned. Solution was really simple:
open 'Advanced Window' on Cisco AnyConnect Secure Mobile Client and click "Allow
local (LAN) access when VPN (if configured)". Restart VPN and DNS starts
working again.
I have no option named like that on my corporate AnyConnect VPN :/
[image: image]
https://user-images.githubusercontent.com/15661640/116699304-b5e0eb80-a9c5-11eb-85ca-800be8d78a49.png
Also tried every solution around the web, setting up the /etc/resolv.conf
with my VPN interface DNS settings didn't help;
Now, I am trying to use Cntlm as a proxy for my WSL2 instance, but I can't
manage to make it work...
I managed to make work docker (based on Hyper-V) with the proxy settings
from Cntlm setup; however from WSL2 it seems like I can't access my local
network or something...
I tried this solution but it didn't work. I have since reverted back to
WSL1
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/WSL/issues/6404#issuecomment-844638011, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AM7YVKBZPH44HTBAJEZ3KWDTORYTTANCNFSM4VWVOLUQ
.

Very, very,  Very sorry but it is written in very small letters in the documentation of the distro, Fedora34, which I use but DNS resolution works amazingly well for me because starting from Fedora 33 resolved is enabled and does all dirty job for me according to its configuration. I disabled resolv.conf generation in the wsl.conf file, then configured my WiFi router DNS service followed by Quad9 DNS as the DNS pool and enabled DoT in the resolved.conf. Dig's trace shows me that Global DNS services, recommended in the config file, eagerly accept encoded DNS requests and respond with encoded answers. resolved also check DNS accessibility, caches address and collects data about DNS. Oh, these are very complex algorithms, but virtually unbreakable from my experience.

It seems lounching VSCode daemon messes things up
Setup below helped me, thanks guys:

/etc/wsl.conf

[network]
generateResolvConf = false

Shutdown wsl

wsl --shutdown

Start wsl, delete /etc/resolv.conf symbolic link and create a file instead:
/etc/resolv.conf

nameserver <IP_ADDRESS>

This worked for me, except I think the more accurate way to do it is to point it to the IP address of your WSL network adapter. That way it'll use whatever DNS your host PC is using. I switched to that after using the above solution, and all is good.

Please, don't propose workarounds before testing them on animals for avert effects. The name resolution is a very sensitive security issue because DNS providers or man-in-the-middle can collect the Internet access history of any user without accessing cookies, etc. It can be used against users or monetized. This problem has been solved by most OS providers including Microsoft and DNS service providers in the years 2020-2021 via switching to TLS-based DNS protocols. What is written about it: Windows DoT support . Linux and Android went far forward - systemd-resolved does DNS negotiation by default.
Who succeeded to activate DNS support in WSL 2 for 5 minutes can install Dig Linux utility to see how the client asks name resolution and how it receives response. Who chooses "Automatic resolv.conf generation" in the wsl.conf does it on own risk.

Going to post this in a few of the longer running threads. Long story short, the AnyConnect fix for this issue is available. The fix requires two pieces, an update to the client of version 4.10.01075 or later and a new custom attribute in the ASDM. Links to info below:
Release Notes
Admin Document Troubleshooting Section that describes the custom attribute that needs to be set up by the VPN adminstrator.

Ladies and Gents, Try this as a possible solution!
I have had the same problem.  The resolv.conf config did work on one laptop but not on another identical laptop. (only difference was : working one uses windows-Home, NOT working one runs Windows-Pro.
I did a downgrade to WSLv1 and it worked again. Upgraded back to WSLv2 and no DNS again.
I found out that the problem is caused (in MY case) by MACAFEE FIREWALL.  As a quick test, DISABLE the firewall and shutdown and restart the WSL. In my case it worked.
Further investigation proved that "enabling" the "adaptive" firewall setting makes all the difference. I now have a working laptop on WSLv2.
Googling on MACAFEE and WSL and DNS, I found out that Macafee does not support WSL at this time :
See here:
https://kc.mcafee.com/corporate/index?page=content&id=KB91411
and here
https://kc.mcafee.com/corporate/index?page=content&id=KB82450
Hopefully, my fix will also work for others following this thread...
Good Luck
Luc DM

For Fedora and Ubuntu remix distro with systemd-genie only: FYI: Fedora DNS resolver. The Fedora remix distro is based on Fedora 33 / 34 and everything written here is applicable to it! The Debian-based systems like Ubuntu have made similar progress too. The DNS resolver configuration is a very personal issue and the selection of DNS provider and protocol depends on the desired level of security and performance, VPN in use, etc. Since Windows 10 has no full support for DNS security offered by Global DNS services like QuadDNS, GoogleDNS, Clogfair, etc. all manipulations with /etc/resolv.conf may not help because it is ignored and the runtime configuration is established by resolved negotiation. To check your runtime configuration run resolvectl.

@shabazz-abdulrahman1 Try to install Fedora remix distro with the recent update. It is based on the Fedora 34, starts with systemd, and uses the recent Linux network stack. If you are ready to spend few days on Networkd, Resolved, resolved.conf, and resolvectl documentation you will be able to fit your distro configuration to almost any Network / VPN type and layout except the Split DNS feature. I'm not sure that your IT will be excited because your name resolution will be almost untrackable unless the corporate DNS server implements certain features. But for freelancers it is very safe and convenient - just follow the Fedora documentation.

following worked for me:

/run/resolvconf/resolv.conf was not created for me - so updated as nameserver <IP_ADDRESS>
also updated the etc/resolv.conf as nameserver <IP_ADDRESS>
update /etc/wsl.conf to
[network]
generateResolvConf = false
restart wsl.  wsl --shutdown

updating only /etc/resolv.conf to nameserver <IP_ADDRESS> didn't work for me. i had to create and update file /run/resolvconf/resolv.conf as well.
-cheers

After the last update of windows few days ago (Insider Preview build 21292.1010 ) I got the dns issue inside wsl.
a long time ago (more than 1 year ago), for the same kind of issue, I had to update the content of /etc/wsl.conf with the following.
[network]
generateResolvConf = false

I Just tried to put it at true, and it fixed the issue.
But not sure it's really something we want, to have a resolv.conf generated.

I just recently updated to Windows 11 beta and setting generateResolveConf = true worked for me.

FYI- Just letting all the upgrades on windows run worked for me

It seems lounching VSCode daemon messes things up
Setup below helped me, thanks guys:

/etc/wsl.conf

[network]
generateResolvConf = false

Shutdown wsl

wsl --shutdown

Start wsl, delete /etc/resolv.conf symbolic link and create a file instead:
/etc/resolv.conf

nameserver <IP_ADDRESS>

This got it to work for me.

I just installed wsl2.
None of them are working for me.
I can not access to internet.
It looks like eth0 is working.
But, I can not ping google.com and apt-get update fails.
6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:9f:e0:ff brd ff:ff:ff:ff:ff:ff
    inet 172.***.***.27/20 brd 172.***.***.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe9f:e0ff/64 scope link
       valid_lft forever preferred_lft forever

Do you have any suggestion for this?

I've documented steps that have worked for me, give these a try.
https://gist.github.com/mandeepsmagh/f1d062fc59e4e6115385c2609b5f0448

@mandeepsmagh
Thanks for that.
I will try it out today.

@mandeepsmagh
I got following error.
ping: google.com: Temporary failure in name resolution
Well...I will try another solution.

@mandeepsmagh
I got following error.
ping: google.com: Temporary failure in name resolution
Well...I will try another solution.

Just trying to make sure my example is easy to understand, you copied nameserver from step 1

and saved to resolv.conf.

I've added nameserver sample nameserver only in my example. It will differ for everyone based on information gathered in
step 1.

@mandeepsmagh
Thanks for comment.
I checked default gateway IP by running ipconfig on windows and copy/paste to /etc/resolv.conf on ubuntu.
But, I am still getting the error.

Same error here. Using WSL Kernel version 5.10.16
I have tried steps found here https://gist.github.com/mandeepsmagh/f1d062fc59e4e6115385c2609b5f0448 but I am still getting the error

I've documented steps that have worked for me, give these a try.
https://gist.github.com/mandeepsmagh/f1d062fc59e4e6115385c2609b5f0448

I've tried this solution. And after relaunching WSL file is missing. I guess disabling this functionality does not work well in some builds.

I am on Windows Insider with Windows 11 WSL2 (and it's graphical kernel?). None of these steps work.
On my version, after the "wsl --shutdown" step, next time WSL starts up, the /etc/resolv.conf mysteriously is deleted.
In windows powershell I run "ping www.google.com" and get an IP.
In WSL2 Ubuntu I do ping . It never returns a result.
Tried to turn off all of firewalls. Still no reply.
Tried to connect to my phone's network (to avoid workplace network), same error.
I'm at a loss.

they could try
echo "nameserver <IP_ADDRESS>" | sudo tee /etc/resolv.conf > /dev/null

FWIW I was experiencing the same issue, with generateResolveConf=false and <IP_ADDRESS>, while connected to a VPN, and the issue went away when I disconnected and reconnected.

In case others come here believing they have a DNS problem and it's not.  My WSL2's DNS was broken, but that was a red herring:  All network access outside of the WSL2 virtual machine was broken.  Didn't notice at first because firewall blocks pinging things like <IP_ADDRESS>.  The real problem?  Hyper-V was not enabled. To enable: in elevated PowerShell, do Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All and boom, DNS working again.  What gave me the idea to check.

After the last update of windows few days ago (Insider Preview build 21292.1010 ) I got the dns issue inside wsl.
a long time ago (more than 1 year ago), for the same kind of issue, I had to update the content of /etc/wsl.conf with the following.
[network]
generateResolvConf = false

I Just tried to put it at true, and it fixed the issue.
But not sure it's really something we want, to have a resolv.conf generated.

I just recently updated to Windows 11 beta and setting generateResolvConf = true worked for me.

same to you,  I also updated windows from win10 to win11,  the WSL2 has no internet connection, but I set generateResolveConfig = true and it works well for me.

FWIW, I found that /etc/resolv.conf is a link to /mnt/wsl/resolv.conf. I had failed to note that before, destroyed the link, and creaetd a new /etc/resolv.conf that never worked after restarting wsl. After adding /etc/wsl.conf to prevent automatic generation of resolv.conf:
[network]
generateResolvConf = false

and adding nameserver <IP_ADDRESS> to /mnt/wsl/resov.conf directly, DNS name resolution is working again.

For me was everything solved by

Go to your user directory in Windows C:\Users\%USERPROFILE%  or simply open file explorer (WIN + E) and type %USERPROFILE%.
Create a .wslconfig file without any extension with VSCode, Sublime, Notepad++, or some other editor.
Insert the following in the file:

[wsl2]
swap=0

Save the file.
Turn off WSL by opening Powershell or Command Prompt and enter wsl --shutdown.
Then start up a new WSL shell.

This might not help everyone but it helped me 😊

For me was everything solved by

Go to your user directory in Windows C:\Users\%USERPROFILE%  or simply open file explorer (WIN + E) and type %USERPROFILE%.
Create a .wslconfig file without any extension with VSCode, Sublime, Notepad++, or some other editor.
Insert the following in the file:

[wsl2]
swap=0

Save the file.
Turn off WSL by opening Powershell or Command Prompt and enter wsl --shutdown.
Then start up a new WSL shell.

This might not help everyone but it helped me 😊

I did @mandeepsmagh 's solution first: https://gist.github.com/mandeepsmagh/f1d062fc59e4e6115385c2609b5f0448
then did this @jccbbb 's solution, didn't know that .wslconfig wasn't created upon WSL2 installation. I thought when docs say about this, I assume I must have installed it incorrectly. It finally worked. Pinged www.google.com and what used to say failure, now gives me a long list of pings. I can do sudo apt update now! Thank you two.

For me was everything solved by

Go to your user directory in Windows C:\Users\%USERPROFILE%  or simply open file explorer (WIN + E) and type %USERPROFILE%.
Create a .wslconfig file without any extension with VSCode, Sublime, Notepad++, or some other editor.
Insert the following in the file:

[wsl2]
swap=0

Save the file.
Turn off WSL by opening Powershell or Command Prompt and enter wsl --shutdown.
Then start up a new WSL shell.

This might not help everyone but it helped me 😊

After Windows Update yesterday, I also got this name resolution problem and none of the solutions suggested here worked except yours. Is this documented somewhere? I want to know what swap=0 mean.

After Windows Update yesterday, I also got this name resolution problem and none of the solutions suggested here worked except yours. Is this documented somewhere? I want to know what swap=0 mean.

After Windows Update yesterday, I also got this name resolution problem and none of the solutions suggested here worked except yours. Is this documented somewhere? I want to know what swap=0 mean.

For me was everything solved by

Go to your user directory in Windows C:\Users\%USERPROFILE%  or simply open file explorer (WIN + E) and type %USERPROFILE%.
Create a .wslconfig file without any extension with VSCode, Sublime, Notepad++, or some other editor.
Insert the following in the file:

[wsl2]
swap=0

Save the file.
Turn off WSL by opening Powershell or Command Prompt and enter wsl --shutdown.
Then start up a new WSL shell.

This might not help everyone but it helped me 😊

After Windows Update yesterday, I also got this name resolution problem and none of the solutions suggested here worked except yours. Is this documented somewhere? I want to know what swap=0 mean.

Thank you! Couldn't use WSL2 for a year but your solution finally solved this god-forsaken problem with WSL2 for me.

For me was everything solved by

Go to your user directory in Windows C:\Users\%USERPROFILE%  or simply open file explorer (WIN + E) and type %USERPROFILE%.
Create a .wslconfig file without any extension with VSCode, Sublime, Notepad++, or some other editor.
Insert the following in the file:

[wsl2]
swap=0

Save the file.
Turn off WSL by opening Powershell or Command Prompt and enter wsl --shutdown.
Then start up a new WSL shell.

This might not help everyone but it helped me 😊

Thank you!!! Couldn't use WSL2 for a year but this finally worked for me

I tried every single suggestion from this issue. None of them worked.
I can ping <IP_ADDRESS> no problem, it's just the DNS that doesn't work

@174n Same here. Received a windows update today and DNS resolution stopped working. Nice job.

"Surely Microsoft update won't break anything" - me few days ago when I decided a year without updates isn't a good idea.

Setting .wslconfig fixes the problem for me. Thanks!

@174n Same here. Received a windows update today and DNS resolution stopped working. Nice job.

Same here. Indeed, the update broke the WSL2 DNS resolution once again. It could be caused by some regression, for the same happened some months ago.

Another workaround is going to network & internet settings, looking up the IPv4 DNS servers and plugging that into the nameserver at /etc/resolv.conf

Currently, unlike disabling the swap file, that seems to be the only working fix.

After Win 11 update WSL2 Ubuntu 20.04 LTS resolver didn't work anymore.
But now it works again with next fixes, using previous hints.
/etc/wsl.conf  [network] generateResolvConf = true
And then on the command prompt:
`cd %USERPROFILE%
echo [wsl2] > .wslconfig
echo swap=0 >> .wslconfig
wsl --shutdown`
After open new Wsl Shell , there is /etc/resolv.conf and more important: dns works. How about tomorrow? We'll see.
But the main question is: why did update from Win 10 To Win 11 generate this  WWP?

@kshji , I've tried your suggestion, but it does not work either.
The resolv.conf file seems to be fine, as well as every vNIC. However, the DNS resolver refuses to work through the vNIC provided by default, but it does work with hand-provided ones.
I thought it might be related to the firewall, but that does not seem to be the case either.
I had the exact same issue some months ago and it eventually turned out to be related to a regression that broke, among others, the vNIC's DNS provisioning, so I guess it might be happening once again.

Disable/enable the hidden WSL interfaces in Windows 11 seems to fix the name resolution in WSL OS. Try to run these commands in admin PowerShell:
Get-NetAdapter -IncludeHidden | Where-Object {$_.InterfaceDescription.StartsWith('Hyper-V Virtual Ethernet Adapter')} | Disable-NetAdapter -Confirm:$False
Get-NetAdapter -IncludeHidden | Where-Object {$_.InterfaceDescription.StartsWith('Hyper-V Virtual Switch Extension')} | Disable-NetAdapter -Confirm:$False
Get-NetAdapter -IncludeHidden | Where-Object {$_.InterfaceDescription.StartsWith('Hyper-V Virtual Switch Extension')} | Enable-NetAdapter -Confirm:$False
Get-NetAdapter -IncludeHidden | Where-Object {$_.InterfaceDescription.StartsWith('Hyper-V Virtual Ethernet Adapter')} | Enable-NetAdapter -Confirm:$False
Or, the simplified version, if you don't have any other Hyper-V related interfaces in the Windows host:
Get-NetAdapter -IncludeHidden | Where-Object {$_.InterfaceDescription.StartsWith('Hyper-V Virtual ')} | Disable-NetAdapter -Confirm:$False
Get-NetAdapter -IncludeHidden | Where-Object {$_.InterfaceDescription.StartsWith('Hyper-V Virtual ')} | Enable-NetAdapter -Confirm:$False

@jozsefhabit , I've also tried your suggestion, albeit unsuccessfully.
Are you applying any previously suggested fix in advance prior to restarting each adapter?

When the issue of WSL2 IPV6 connectivity in Win 11 will be solved finally? When local ISP's had been allowed to phase out IPV4 infrastructure  as the customer's density problem solution and cost reduction measure regionally available DNSs began to work normally only via IPV6 DNSSec. Otherwise they don't response or can't resolve names to IPV4 addresses. I had to resolve this issue also on my smartphones too. Fortunately,  my ISP supplies working IPV6 DNS address in "Automatic DNS resolution" mode. If somebody uses WiFi router with configurable built-in DNS forwarder available on <IP_ADDRESS> it can help as workaround. Chrome complains sometimes but works.

nameserver <IP_ADDRESS>

The VPN is what was getting on my way! Thank you for your comment.

@jozsefhabit , I've also tried your suggestion, albeit unsuccessfully.
Are you applying any previously suggested fix in advance prior to restarting each adapter?

It definitely working for me, it seems that our issues have different root causes.
One more thing that i'm doing is to shutdown wsl before the operations:
wsl --shutdown

@jozsefhabit , I've also tried your suggestion, albeit unsuccessfully.
Are you applying any previously suggested fix in advance prior to restarting each adapter?

It definitely working for me, it seems that our issues have different root causes.
One more thing that i'm doing is to shutdown wsl before the operations:
wsl --shutdown

My Avast Antivirus Firewall blocking DNS resolutions from WSL2. 🤦🏻♂
Added rule for allow.
After wsl --shutdown now it's working. 👍

For me was everything solved by

Go to your user directory in Windows C:\Users\%USERPROFILE%  or simply open file explorer (WIN + E) and type %USERPROFILE%.
Create a .wslconfig file without any extension with VSCode, Sublime, Notepad++, or some other editor.
Insert the following in the file:

[wsl2]
swap=0

Save the file.
Turn off WSL by opening Powershell or Command Prompt and enter wsl --shutdown.
Then start up a new WSL shell.

This might not help everyone but it helped me 😊

Tried everything and finally did this work after a long time.

I had a similar problem - updating Bitdefeneder resolved the issue.

Another workaround is going to network & internet settings, looking up the IPv4 DNS servers and plugging that into the nameserver at /etc/resolv.conf

This worked for me

After searching "every" hit from google, I found the following which, for some reason, seems to have resolved the issue. Added options rotate as the first line in /etc/resolv.conf and restarted LxssManager - DNS works. Source

The funny thing that my connection is dropping after ~10 seconds after WSL2 start:

user@ubuntu:~$ ping google.com
PING google.com (<IP_ADDRESS>) 56(84) bytes of data.
64 bytes from hem09s03-in-f14.1e100.net (<IP_ADDRESS>): icmp_seq=1 ttl=55 time=8.81 ms
64 bytes from hem09s03-in-f14.1e100.net (<IP_ADDRESS>): icmp_seq=2 ttl=55 time=25.0 ms
64 bytes from hem09s03-in-f14.1e100.net (<IP_ADDRESS>): icmp_seq=3 ttl=55 time=10.2 ms
64 bytes from hem09s03-in-f14.1e100.net (<IP_ADDRESS>): icmp_seq=4 ttl=55 time=14.3 ms
64 bytes from hem09s03-in-f14.1e100.net (<IP_ADDRESS>): icmp_seq=5 ttl=55 time=8.31 ms
64 bytes from hem09s03-in-f14.1e100.net (<IP_ADDRESS>): icmp_seq=6 ttl=55 time=12.5 ms
64 bytes from hem09s03-in-f14.1e100.net (<IP_ADDRESS>): icmp_seq=7 ttl=55 time=9.17 ms
64 bytes from hem09s03-in-f14.1e100.net (<IP_ADDRESS>): icmp_seq=8 ttl=55 time=9.27 ms
^C
--- google.com ping statistics ---
89 packets transmitted, 8 received, 91.0112% packet loss, time 91200ms
rtt min/avg/max/mdev = 8.308/12.194/24.967/5.192 ms

And then

user@ubuntu:~$ ping google.com
ping: google.com: Temporary failure in name resolution

None of above approaches helped....

This solved my issue

1 . Rename link /etc/resolv.conf :
> sudo mv /etc/resolv.conf /etc/resolv.conf.old

Doing this and changing permission to 777 worked for me

Microsoft should be fixing this issue. Till then as a workaround, we can use wsl-vpnkit which takes care of the DNS changes.
A very detailed article here - https://medium.com/twodigits/install-docker-on-wsl-2-with-vpn-support-to-replace-docker-for-windows-45b8e200e171

These steps helped me (the answer by Gamepad.Coder on this question ):

Open Powershell or Cmd as Administrator
and run each of these commands:

wsl --shutdown
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns

Hit the Windows Key,
type Network Reset,
hit enter.

You should see this window.
Click "Reset now".

Restart Windows

Reboot your system, it helps me.

in my case:
if the file /etc/wsl.conf  looks like this:
[network]
generateResolvConf = false
That means you'll need to add your own nameservers to this file:
resolv.conf
I figured out that if I have several nameservers in resolv.conf only the server at the top is used to resolve names, so I had to manually move the appropriate nameserver to the top depending of the network being used (work VPN, home, etc).... so a better solution was adding these lines at the top of resolv.conf:
options rotate
options timeout:1
source:
https://www.linuxhowtos.org/Tips and Tricks/improving_dns_lookups.htm
Optionally if your resolv.conf file changes when rebooting or upgrading, make the resolv.conf file inmutable:
sudo chattr +i /etc/resolv.conf
source:
https://askubuntu.com/questions/1347712/make-etc-resolv-conf-changes-permanent-in-wsl-2
hope this works for you too.

I've been following this issue for what seems like years, and it is very much a moving target as various companies update their products. However, I've found some more clues at what might be going on.
First and foremost:

I am running WSL2 and Ubuntu 20.04.
I have tried the custom resolv.conf settings above, as well as leaving it alone.
I have tried setting the swap to 0 in my appdata.
I tried turning off IPv6 on my wifi, vEthernet, and VPN network adapters.
None of the above fixes work when I turn on my VPN.
My VPN is Cisco Anyconnect Secure Mobility Client, version 4.10.05095. According to the Connection Information, the Tunnel Mode is "Split Include" for IPv4 and "Drop All Traffic" for IPv6. All Dynamic Tunnel settings are marked "None."

I found a potential hint for this particular issue here:
https://superuser.com/questions/1715764/wsl2-has-no-connectivity-when-windows-is-connected-to-vpn
When I run "route print" in powershell, I see the following:
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
      <IP_ADDRESS>    <IP_ADDRESS>         On-link       <IP_ADDRESS>   5256

After firing up my VPN, a LOT of new ip routes are added, but this is the only duplicate:
Network Destination        Netmask          Gateway       Interface  Metric
      <IP_ADDRESS>    <IP_ADDRESS>         On-link       <IP_ADDRESS>   5256
      <IP_ADDRESS>    <IP_ADDRESS>     <IP_ADDRESS>     <IP_ADDRESS>      2

This fits other observations: The VPN is adding a split tunnel route on top of the WSL subnet, and as a result all WSL traffic is talking to the VPN. And because the VPN has no clue how to route that or what to do with it, the messages die. In fact, I can't even ping the gateway or the interface of the VPN connection.
So with this particular problem, I'm not even getting to the point of the system using the wrong nameservers, like I was a couple years back.
I suspect that this relates to issues with updating either Windows or the Cisco AnyConnect product. These updates may break a link somewhere in the system, requiring a reinstall. However, I do not want to go through the hassle of reinstalling WSL every time a Windows Update is pushed by our corporate Endpoint Support.
Hopefully this provides some clues that others can use to troubleshoot this. I know I've seen workarounds that involve changing the metrics, but I am not sure how to target that to just this one route.

Recently Windows required an update, I installed and now I have this problem using Ubuntu with WSL2...

Happens to me as well.
Turning off generateResolvConf and writing static DNS server to resolv.conf is not a good solution for me, because I often need to switch networks, some of them need private DNS resolution too. So this is more like a workaround not a solution to the root cause.

None of the solution given above is working. Any other workaround?

I didn't start to investigate why, but I noticed that if do steps what were already mentioned before (/etc/resolv.conf etc.), and start WSL2 BEFORE you connect to VPN Cisno WSL2 is working, if you start your WSL2 AFTER VPN Cisno, then WSL2 has no connect to internet, and then you should reboot PC. Because standard wsl --shutdown won't help....Hope it helps.

@PavelSosin-320
You have to change  sudo nano /etc/wsl.conf.
[network]
generateResolvConf = false

After that go to sudo nano /etc/resolv.conf delete everything there and put your desired nameservers there:
nameserver <IP_ADDRESS>

After that in Powershell type wsl --shutdown.
Now your resolv.conf will be the same.

Tried this, but /etc/resolv.conf is removed after wsl --shutdown.
sudo ls /etc/resolv.conf ls: cannot access '/etc/resolv.conf': No such file or directory

@PavelSosin-320
You have to change  sudo nano /etc/wsl.conf.
[network]
generateResolvConf = false

After that go to sudo nano /etc/resolv.conf delete everything there and put your desired nameservers there:
nameserver <IP_ADDRESS>

After that in Powershell type wsl --shutdown.
Now your resolv.conf will be the same.

Tried this, but /etc/resolv.conf is removed after wsl --shutdown.
sudo ls /etc/resolv.conf ls: cannot access '/etc/resolv.conf': No such file or directory

Microsoft should be fixing this issue. Till then as a workaround, we can use wsl-vpnkit which takes care of the DNS changes.
A very detailed article here - https://medium.com/twodigits/install-docker-on-wsl-2-with-vpn-support-to-replace-docker-for-windows-45b8e200e171
Just follow vpnkit installation and startup step

wsl-vpnkit is the only option that worked for me.

This recommendation from the vpnkit article above made my WSL2 working without any /etc/wsl.conf or %userprofile%.wslconfig.
sudo touch /etc/fstab
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
sudo service docker start

Rebooting worked for me without having to create any /etc/wsl.conf or %userprofile%\\.wslconfig.  That is, starting the docker service inside my WSL2 Debian did not affect resolving or pinging a known site.
I also noticed that the auto-generated /etc/resolv.conf has a nameserver line with the IPv4 address of my Windows Ethernet adapter vEthernet (WSL) as shown by ipconfig.

Fix for VPN:

Find out nameserver with windows powershell (during VPN Session and without) using nslookup
USe sudo touch /etc/wsl.conf and sudo vim /etc/wsl.conf to add:

[network]
generateResolvConf = false

Restart wsl (Windows powershell) using wsl --shutdown
Open WSL and remove using rm -f /etc/resolv.conf
Add new file sudo touch /etc/resolv.conf and sudo vim /etc/resolv.conf with:

nameserver X.X.X.X

nameserver Y.Y.Y.Y

Restart wsl (Windows powershell) using wsl --shutdown
Open WSL and remove using wget google.com and test some you corporate domain.

Worked form me: get name server via nslookup, in resolv.conf options rotate and options timeout:1 on top, then all my possible nameservers below

For me, fix was rather simple, Network mode was set to public, and box "Block all incoming connections, including those in the list of allowed apps." was ticked. After it is unchecked, even auto-generated resolved.conf worked form me.

This solved my issue

1 . Rename link /etc/resolv.conf :
> sudo mv /etc/resolv.conf /etc/resolv.conf.old

Doing this and changing permission to 777 worked for me

Thanks!

I've tried every enlisted here solution - nothing helps. The only solution which is helped me is this one: https://learn.microsoft.com/en-us/windows/wsl/troubleshooting?source=recommendations#wsl-has-no-network-connectivity-once-connected-to-a-vpn
Generally, you just get the list of DNS servers used by your VPN via ipconfig.exe /all, and then copy-paste all these IPs from the DNS section to the /etc/resolv.conf. Restarting WSL and everything is working!

Guys, just try wsl-vpnkit.
At least I can with it use WSL while on VPN.
https://crapts.org/2022/05/17/wsl2-network-connectivity-when-using-a-vpn/

Any solution for that ? I've tried all these sugestions above but nothing works.

My 2 cents
No one of the suggestions mentioned in this thread worked for me, probably I'm an edge case scenario as I'm using 2 VPN clients.
But one simple change did the trick: thanks to Alistar Young
https://randombytes.substack.com/p/bridged-networking-under-wsl
If you have this recent WSL version
>wsl --version
Versione WSL: <IP_ADDRESS>
Versione kernel: <IP_ADDRESS>
Versione WSLg: 1.0.49
Versione MSRDC: 1.2.3770
Versione Direct3D: 1.608.2-61064218
Versione DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
versione Windows: 10.0.22621.1265

just create a bridged Hyper-V adapter and add these lines to .wslconfig
[wsl2]
networkingMode = bridged
vmSwitch = <bridgeAdapterName>

The properties are NOT documented yet (https://learn.microsoft.com/en-us/windows/wsl/wsl-config), but it made my day.

In my environment, I found a 3rd party security software (like ESET McAffe ) blocked WSL from working DNS. Only disabling a firewall of a security software works fine.

In my case, I've disabled Internet Protocol Version 6 (TCP/IPv6) in WLAN Properties of Network Connections Settings.
Configuration Screenshot:

Ping GitHub.com Successfully Screenshot:

Source:
https://unix.stackexchange.com/a/628767/338681

Check this detailed article with the proper steps . By following these comprehensive troubleshooting steps, you can effectively diagnose and resolve most WSL DNS issues, ensuring smooth operation and minimal downtime.

If you are getting a Temporary Failure In Name Resolution error on WSL2 then follow these solutions to fix the issue in no time

How is this still an issue?

I Just tried to put it at true, and it fixed the issue. But not sure it's really something we want, to have a resolv.conf generated.

@ludzzz this resolved my issue , thanks

Hi folks, we have put out a new update that aims to address networking issues in WSL. In your .wslconfig file you can set experimental.networkingMode=mirrored, as well as some other key settings that should improve your network compatibility! Please try them out and let us know what you think.
More info on this release and the changes can be found here in the blog post.
Please note: You need to be on a Windows Insiders version to use the new networking settings (Any channel of Windows Insiders will do, including release preview). If you see the "These are not supported" messages it means that your current Windows version doesn't have support, and you will need to upgrade. These features will eventually be coming to Windows 11 22H2.

These steps helped me (the answer by Gamepad.Coder on this question ):

Open Powershell or Cmd as Administrator
and run each of these commands:

wsl --shutdown
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns

Hit the Windows Key,
type Network Reset,
hit enter.

You should see this window. Click "Reset now".

Restart Windows

This worked for me no problem!

This worked for me too, Windows 10 Build 19045, WSL2, Ubuntu 22.04

These new networking features are now available on the latest version of Win11 22H2!
Please make sure you're on the latest build to get these features, you can do that by clicking "Check for Updates" in Windows settings. You can check you have the right build by either ensuring you have KB5031354 installed, or run cmd.exe /c ver and ensure that your build number is 22621.2428 or higher (Including the minor build number which is after the . as this was a backport!)

Added
[experimental]
networkingMode=mirrored

to my .wslconfig and DNS is now working.
My dns config is custom nameserver and search options in /etc/resolv.conf

I tried the new mirrored networking mode, but Docker Desktop crashed after its first reboot, though everything else seemed to work properly.
After that, I performed the factory reset encouraged by Docker Desktop and it worked fine until the next engine restart or system reboot instead. Then, the engine startup crashed once again, and so on. Furthermore, the Kubernetes feature did not even initialise for the first time, no matter how many restarts, factory resets or reboots I performed.
Once .wslconfig became saved with the networking mode reverted to NAT, things went back to normal with no restart, factory reset, or reboot at all.
Bearing in mind everything seemed to work flawlessly and blazing fast, but Docker Desktop, I'm not really sure whether this was a compatibility issue on the WSL side or on the Docker side instead.

Added
[experimental]
networkingMode=mirrored

to my .wslconfig and DNS is now working. My dns config is custom nameserver and search options in /etc/resolv.conf

Mirrored mode is definitely the way to go! For those who would like to understand how it works/why it's better: here's a decent article+video on it, and here's a link to the documentation. Mirrored mode has now moved from being an experimental feature to being a stable feature under the [wsl2] section. Another thing people should probably turn on for DNS issues caused by VPNs is the new dnsTunneling feature which communicates directly to the windows host to resolve hostnames instead of sending network packets which can be blocked or interfered with by VPNs. So DNS tunneling should help avoid network issues in WSL caused by VPNs.

This worked for me
sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver <IP_ADDRESS>" > /etc/resolv.conf'
sudo bash -c 'echo "[network]" > /etc/wsl.conf'
sudo bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
sudo chattr +i /etc/resolv.conf

Source:  https://askubuntu.com/a/1398053

This worked for me
sudo rm /etc/resolv.conf
sudo bash -c 'echo "nameserver <IP_ADDRESS>" > /etc/resolv.conf'
sudo bash -c 'echo "[network]" > /etc/wsl.conf'
sudo bash -c 'echo "generateResolvConf = false" >> /etc/wsl.conf'
sudo chattr +i /etc/resolv.conf

Source: https://askubuntu.com/a/1398053

I can confirm. This worked for me as well.

These steps helped me (the answer by Gamepad.Coder on this question ):

Open Powershell or Cmd as Administrator
and run each of these commands:

wsl --shutdown
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns

Hit the Windows Key,
type Network Reset,
hit enter.

You should see this window. Click "Reset now".

Restart Windows

This worked for me no problem!

This worked for me too, Windows 10 Build 19045, WSL2, Ubuntu 22.04

This solution worked for me. But when I disconnect from the VPN and connect again, I have the same problem again and I have to repeat the whole process again and restart. Has it happened to anyone else?

> We suffer from the same issue.
WSL2 looses network connectivity on certain cases like:

Windows goes to sleep
VPN client crashes or the lease finishes
Network adapter is changed  (Wifi to LAN or the other way)

What we found out is that in case where the connectivity is lost, there are additional routes in the routing table in Windows attached to the VPN Adapter with the destination of the WSL Adapter (or more, the IP-Range of the WSL Adapter). If we remove this routes, the connectivity comes back immediately.
Here is a script that lists all relevant routes regarding WSL (adjust the <your adapter identifer> for your VPN adapter). For us, when there are any routes in the section Routes for the VPN Adapter, WSL is offline. And if we delete all these routes, WSL2 gets connectivity back immediately.
function main {

 $adapterVpn = Get-NetAdapter -InterfaceDescription "<your adapter identifer>"
 $adapterWsl = Get-NetAdapter -Name "vEthernet (WSL)"
 $ipInfoVpn = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex
 $ipInfoWsl = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
 $wslCidr = "$($ipInfoWsl.IPAddress)/$($ipInfoWsl.PrefixLength)"

 $ipInfoWslVm = wsl -- ip -o -4 -json addr list eth0 `
     | ConvertFrom-Json `
     | %{ $_.addr_info.local } `
     | ?{ $_ }

 Write-Host "=== VPN (ID $($adapterVpn.ifIndex)) ==="
 Write-Host "IP: $($ipInfoVpn.IPAddress)"
 Write-Host
 Write-Host "=== WSL Adapter (ID $($adapterWsl.ifIndex)) ==="
 Write-Host "IP: $($ipInfoWsl.IPAddress)"
 Write-Host "MASK: $(convert-cidr-to-string -cidr $ipInfoWsl.PrefixLength) (/$($ipInfoWsl.PrefixLength))"
 Write-Host
 Write-Host "=== WSL VM ==="
 Write-Host "IP: $($ipInfoWslVm)"
 Write-Host

 $routesWsl = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
 $routesVpn = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex

 Write-Host "=== Routes for the WSL Adapter ==="
 $routesWsl | Format-Table `
     @{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
     @{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
     @{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
     NextHop

 Write-Host "=== Routes for the VPN Adapter ==="
 $routesVpn | Where-Object { is-cidr-in-cidr-range $wslCidr $_.DestinationPrefix } | Format-Table `
     @{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
     @{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
     @{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
     NextHop
}

function convert-cidr-to-string {
 param($cidr)
 $shift = 64 - $cidr
 [System.Net.IPAddress]$subnet = 0
 $subnet = [System.Net.IPAddress]::HostToNetworkOrder([int64]::MaxValue -shl $shift)
 return $subnet.IPAddressToString
}

function convert-cidr-range-to-address-string {
 param($cidrNotation)
 return $cidrNotation.split('/')[0]
}

function convert-cidr-range-to-mask-string {
 param($cidrNotation)
 return convert-cidr-to-string -cidr $cidrNotation.split('/')[1]
}

function is-cidr-in-cidr-range {
 param (
     [string] $cidrNotationRange,
     [string] $cidrCurrent
 )

 $ip = convert-cidr-range-to-address-string $cidrCurrent

 $min, $max = cidr-to-ip-range $cidrNotationRange
 return ([version]$min) -le ([version]$ip) -and ([version]$ip) -le ([version]$max)
}

function cidr-to-ip-range {
 param (
     [string] $cidrNotation
 )

 $addr, $maskLength = $cidrNotation -split '/'
 [int]$maskLen = 0
 if (-not [int32]::TryParse($maskLength, [ref] $maskLen)) {
     throw "Cannot parse CIDR mask length string: '$maskLen'"
 }
 if (0 -gt $maskLen -or $maskLen -gt 32) {
     throw "CIDR mask length must be between 0 and 32"
 }
 $ipAddr = [Net.IPAddress]::Parse($addr)
 if ($ipAddr -eq $null) {
     throw "Cannot parse IP address: $addr"
 }
 if ($ipAddr.AddressFamily -ne [Net.Sockets.AddressFamily]::InterNetwork) {
     throw "Can only process CIDR for IPv4"
 }

 $shiftCnt = 32 - $maskLen
 $mask = -bnot ((1 -shl $shiftCnt) - 1)
 $ipNum = [Net.IPAddress]::NetworkToHostOrder([BitConverter]::ToInt32($ipAddr.GetAddressBytes(), 0))
 $ipStart = ($ipNum -band $mask)
 $ipEnd = ($ipNum -bor (-bnot $mask))

 # return as tuple of strings:
 ([BitConverter]::GetBytes([Net.IPAddress]::HostToNetworkOrder($ipStart)) | ForEach-Object { $_ } ) -join '.'
 ([BitConverter]::GetBytes([Net.IPAddress]::HostToNetworkOrder($ipEnd)) | ForEach-Object { $_ } ) -join '.'
}

main

This has worked very good for me the last couple of months, thank you Roemer!
I usually lose internet in WSL (using VPN) after sleep mode or moving from Wifi to LAN.
I have adjusted your script to be required to be ran as admin
#Requires -RunAsAdministrator

and to auto delete the routes it finds.
function main {

    $adapterVpn = Get-NetAdapter -InterfaceDescription "<your adapter identifer>"
    $adapterWsl = Get-NetAdapter -Name "vEthernet (WSL)"
    $ipInfoVpn = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex
    $ipInfoWsl = Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
    $wslCidr = "$($ipInfoWsl.IPAddress)/$($ipInfoWsl.PrefixLength)"

    $ipInfoWslVm = wsl -- ip -o -4 -json addr list eth0 `
        | ConvertFrom-Json `
        | %{ $_.addr_info.local } `
        | ?{ $_ }

    Write-Host "=== VPN (ID $($adapterVpn.ifIndex)) ==="
    Write-Host "IP: $($ipInfoVpn.IPAddress)"
    Write-Host
    Write-Host "=== WSL Adapter (ID $($adapterWsl.ifIndex)) ==="
    Write-Host "IP: $($ipInfoWsl.IPAddress)"
    Write-Host "MASK: $(convert-cidr-to-string -cidr $ipInfoWsl.PrefixLength) (/$($ipInfoWsl.PrefixLength))"
    Write-Host
    Write-Host "=== WSL VM ==="
    Write-Host "IP: $($ipInfoWslVm)"
    Write-Host

    $routesWsl = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterWsl.ifIndex
    $routesVpn = Get-NetRoute -AddressFamily IPv4 -InterfaceIndex $adapterVpn.ifIndex

    Write-Host "=== Routes for the WSL Adapter ==="
    $routesWsl | Format-Table `
        @{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
        @{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
        @{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
        NextHop

    Write-Host "=== Routes for the VPN Adapter ==="
    $routesVpn | Where-Object { is-cidr-in-cidr-range $wslCidr $_.DestinationPrefix } | Format-Table `
        @{L=’Dst Address’;E={convert-cidr-range-to-address-string $_.DestinationPrefix}}, `
        @{L=’Dst Mask’;E={convert-cidr-range-to-mask-string $_.DestinationPrefix}}, `
        @{L="Metric";E={$_.InterfaceMetric + $_.RouteMetric}}, `
        NextHop

+    $toDelete = $routesVpn | Where-Object { is-cidr-in-cidr-range $wslCidr $_.DestinationPrefix }
+    Write-Host "Routes to be deleted:"
+    Write-Host $toDelete
+    Remove-NetRoute -InputObject $toDelete -Confirm:$false
}

FYI
Modification of Registry Keys
Location: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
位置： HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
Name: DisabledComponents 名称：DisabledComponents
Type: REG_DWORD 类型： REG_DWORD
Min Value: 0x00 (default value)
Max Value: 0xFF (IPv6 disabled)
change the value to 0x20 (hex) or 32 (decimal) to re-enable IPv6

In case anyone finds it useful, I've had no single issue over several months, and pretty reliable, robust and fast connections while using the following %HOMEPATH%\.wslconfig file:
[wsl2]
networkingMode=mirrored
firewall=true
dnsTunneling=true
autoProxy=true

[experimental]
hostAddressLoopback=true
autoMemoryReclaim=gradual
sparseVhd=true

Please, kindly check this doc for a description each property's behaviour, and other properties or values you may find required for your custom setup.


Improve documentation about custom buttons.

Now it is not clear from documentation how to add custom buttons to implement some behavior with state manipulations.
For example: how can we implement undo, redo buttons?
Now I'm using this code(not an expert in angular)
 @ViewChild('ngx', {static: false})
    ngx: NgxWigComponent;
    @Input()
    content = 'sss';
    inputStates: string[] = [];
    undoStats = 0;
    ngAfterViewInit(): void {
      this.ngx.toolbarButtons.push({
          label: 'Undo',
          title: 'Undo',
          command: (ctx: NgxWigComponent) => {
            this.undo();
          },
          styleClass: 'nw-button',
          icon: 'icon-custom'
        });
      this.ngx.toolbarButtons.push({
          label: 'Redo',
          title: 'Redo',
          command: (ctx: NgxWigComponent) => {
            this.redo();
          },
          styleClass: 'nw-button',
          icon: 'icon-custom'
        });
  }

Not just something to undo-redo editing?
undo: {     label: 'Undo',     title: 'Undo',     command: 'undo',     styleClass: 'nw-button',   },   redo: {     label: 'Redo',     title: 'Redo',     command: 'redo',     styleClass: 'nw-button'   }

@hodzanassredin thank you for your question, do you want to add it to the documentation?
I mean solution from @MPapini91

undo: { label: 'Undo', title: 'Undo', command: 'undo', styleClass: 'nw-button', }, redo: { label: 'Redo', title: 'Redo', command: 'redo', styleClass: 'nw-button' }

I don't understand how does it work. I can't find where these commands are described in the source code of ngx-wig. Could you please clarify?

Ok, to add custom buttons you can follow this example from documentation (I quite didn't understand your approach sorry) and add to the variable MY_PLUGIN your custom buttons, like:
const MY_PLUGIN = {
  edithtml: {
    label: 'Custom button',
    title: 'Custom button',
    command: (ctx: NgxWigComponent) => {
      alert('This is a custom button');
    },
    styleClass: 'nw-button',
    icon: 'icon-custom',
  },
  undo: {
    label: 'Undo',
    title: 'Undo',
    command: 'undo',
    styleClass: 'nw-button',
  },
  redo: {
    label: 'Redo',
    title: 'Redo',
    command: 'redo',
    styleClass: 'nw-button',
  },
};

If you want a reference to the source code, I think you can look to the example app in src/app/app.module.ts and add the same code for undo redo in the DEFAULT_LIBRARY_BUTTONS variable (but I didn't try so better ask to @stevermeister )

Ah, for the command you can pass a function or a command from this list


Added usage notes for brew installations in other paths than /usr/local

Thank you for your contribution! I have updated the wording a bit.

Thank you for your contribution! I have updated the wording a bit.


Please document how one sets a userpic

It's not clear to me which things on my sites map to the user icons on the bridged service.
On https://beesbuzz.biz, bridged to https://bsky.app/profile/beesbuzz.biz, it seems to be using my h-card u-image.
On https://sockpuppet.band, bridged to https://bsky.app/profile/sockpuppet.band, it seems to be using a  low-resolution link rel="icon".
On https://novembeat.com, bridged to https://bsky.app/profile/novembeat.com, no icon is appearing at all, even though it provides a link rel="icon" (albeit without a specified resolution).
I assume that the recommendation is to provide an h-card with a u-image in some way, or that there will be a fallback to a link rel="icon" using some particular logic, but it would be really nice if this were in the docs.

@fluffy-critter https://fed.brid.gy/docs#web-profile ?

Ah, thanks, I searched all over but couldn't find that for some reason.

Oh wait there's another issue related to this, though: with novembeat.com, fed.brid.gy was showing the icon on the user page, but it isn't coming through to the bsky profile. I also can't figure out how to refresh the others with correct icons. Will that happen eventually on its own or is that a thing that can be prodded somehow?

Ugh yeah, this is a separate problem. ATProto repos sometimes get "stuck" in the Bluesky appview and new records don't show up. I haven't yet found a consistent way to debug or fix this, sigh.
Eg your profile record for that account https://atproto-browser.vercel.app/at/novembeat.com/app.bsky.actor.profile/self looks fine, but it's not currently reflected on https://bsky.app/profile/novembeat.com


Update avail-sl-integrations.md

fixes broken hex link in the avail integrations page for SL.
Resolves #6263
Raised by @farmanp

working in preview, merging


hunger games for android

fixes #2031

Note to self, change to the production URL before release.


Keybindings not working

Hi,
The keybing to add +5 unit movement it's not working. I add any and when go to game it just not work.

Will check when i get home tonight and will push an update tomorrow morning
to fix the keybinds
On Fri, 11 Nov 2022, 10:06 Nuno Miguel, @.***> wrote:

Hi,
The keybing to add +5 unit movement it's not working. I add any and when
go to game it just not work.
—
Reply to this email directly, view it on GitHub
https://github.com/sparrow8332/Advanced-Cheat-Menu/issues/17, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AC4EBHAB5GBJ3CLMAUVIGCDWHYLDNANCNFSM6AAAAAAR5OIAKM
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>


parse error extract function

Actual Behavior
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "DAY" <S_IDENTIFIER>
at line 1, column 71.
Was expecting one of:
"&"
")"
"::"
"<<"
">>"
"^"
"|"

at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:18047)

Expected Behavior
Steps to Reproduce the Problem
String sql = "select EXTRACT(DAY FROM (SYSDATE - to_date('20180101', 'YYYYMMDD' ) ) DAY TO SECOND)  from dual;";
JSqlParser jSqlParser = new CCJSqlParserManager();
try {
jSqlParser.parse(new StringReader(sql));
} catch (JSQLParserException e) {
e.printStackTrace();
}
Specifications

Version:
Platform:
Subsystem:

How to solve this? Facing the same problem

DAY FROM ... and DAY TO ... are not supported since it is not SQL Standard compliant.
You can either provide or sponsor an implementation for the platform specific syntax.

@manticore-projects This is not quite right, since SpecialStringFunctionWithNamedParameters with NamedExpressionListExprFirst and the following is able to accept e.g. substring( a from b). This way the extract should be accepted as well.
This is parsed
select EXTRACT(DAY FROM (SYSDATE - to_date('20180101', 'YYYYMMDD' ) ) ) from dual;

So maybe this DAY TO SECONDS can be implemented this way as well.

In my opinion, this particular production NamedExpressionListExprFirst is cursed (since it depends on a semantic LOOKAHEAD) and should be replaced with a proper implementation of the SQL:2016 standard functions. I did convert() and trim() already and will do the others next.
NameExpressionList must die (although I have  tamed it already by streamlining it into an extension of ExpressionList).

@manticore-projects :) You are right, it was a hack, but since you already started discussing a new version, isn't that a bit to much?
The lookahead here is not that bad, since it is drastically filtered by this function name list.

I leave it to you to decide. In the current development stage it extends ExpressionList and so fits in much better.
However, I consider it a kind of generic fallback, while I still would provide the SQL:2016 compliant functions separately.
(It's a shame that SQL standard allowed those syntax, when regular functions with comma separated parameters would have done a fine job.)


gitoxide: 0.28.0 -> 0.29.0

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/Byron/gitoxide/releases.
meta.description for gitoxide is: A command-line application for interacting with git repositories
meta.homepage for gitoxide is: https://github.com/Byron/gitoxide
meta.changelog for gitoxide is: https://github.com/Byron/gitoxide/blob/v0.29.0/CHANGELOG.md
Updates performed

Rust version update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact

Checks done (click to expand)

built on NixOS
The tests defined in passthru.tests, if any, passed
found 0.29.0 with grep in /nix/store/amy5d11z12b0407zgg4vaa335bvj9zhz-gitoxide-0.29.0
found 0.29.0 in filename of file in /nix/store/amy5d11z12b0407zgg4vaa335bvj9zhz-gitoxide-0.29.0

Rebuild report (if merged into master) (click to expand)

1 total rebuild path(s)

1 package rebuild(s)

First fifty rebuilds by attrpath
gitoxide

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/amy5d11z12b0407zgg4vaa335bvj9zhz-gitoxide-0.29.0 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A gitoxide https://github.com/r-ryantm/nixpkgs/archive/3f9ea77d2f8f2d8fdba687667b7545519112eadd.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/amy5d11z12b0407zgg4vaa335bvj9zhz-gitoxide-0.29.0
ls -la /nix/store/amy5d11z12b0407zgg4vaa335bvj9zhz-gitoxide-0.29.0/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package built:

gitoxide

Maintainer pings
cc @syberant for testing.

Result of nixpkgs-review pr 252136 run on x86_64-linux 1

1 package built:

gitoxide