From 609a8ef26345167241bb2a58656666a307dbba58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20Emil=20Fetoiu?= Date: Tue, 2 Jul 2024 14:06:11 -0700 Subject: [PATCH] Doc updates for dnsTunneling and autoProxy (#1970) * dns and proxy doc updates * add dnsTunnelingIpAddress setting * mention generateHosts option * move bullet point * rephrase docker desktop point --------- Co-authored-by: Catalin-Emil Fetoiu --- WSL/troubleshooting.md | 8 +++++--- WSL/wsl-config.md | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/WSL/troubleshooting.md b/WSL/troubleshooting.md index fc05283b..b2ec5a4a 100644 --- a/WSL/troubleshooting.md +++ b/WSL/troubleshooting.md @@ -267,6 +267,8 @@ When enabled, the following apply to proxy settings on your Linux distributions: - The Linux environment variable, `NO_PROXY`, is set to bypass any HTTP/S proxies found in the Windows configuration targets. - Every environment variable, except `WSL_PAC_URL`, is set to both lower case and upper case. For example: `HTTP_PROXY` and `http_proxy`. +There is a known issue caused by ZScaler configurations, where ZScaler repeatedly enables and disables Windows proxy configurations, leading to WSL repeatedly showing the "An Http proxy change has been detected on the host" notification. + Learn more in the Command Line blog: [WSL September 2023 update](https://devblogs.microsoft.com/commandline/windows-subsystem-for-linux-september-2023-update/#autoproxy). ### Networking considerations with DNS tunneling @@ -275,7 +277,6 @@ When WSL can’t connect to the internet, it might be because the DNS call to th DNS Tunneling can be configured using the `dnsTunneling` setting in the [experimental section of the WSL Configuration file](/windows/wsl/wsl-config#experimental-settings). When applying this setting, note these considerations: -- Native Docker can have connectivity issues in WSL when DNS tunneling is enabled – if the network has a policy to block DNS traffic to: 8.8.8.8 - If you use a VPN with WSL, turn on DNS tunneling. Many VPNs use NRPT policies, which are only applied to WSL DNS queries when DNS tunneling is enabled. - The `/etc/resolv.conf` file in your Linux distribution has a 3 DNS servers maximum limitation, while Windows may use more than 3 DNS servers. Using DNS tunneling removes this limitation – all Windows DNS servers can now be used by Linux. - WSL will use Windows DNS suffixes in the following order (similar to the order used by the Windows DNS client): @@ -283,8 +284,9 @@ DNS Tunneling can be configured using the `dnsTunneling` setting in the [experim 2. Supplemental DNS suffixes 3. Per-interface DNS suffixes 4. If DNS encryption (DoH, DoT) is enabled on Windows, encryption will be applied to DNS queries from WSL. If users want to enable DoH, DoT inside Linux, they need to disable DNS tunneling. -- DNS queries from Docker containers (either Docker Desktop or native Docker running in WSL) will bypass DNS tunneling. DNS tunneling cannot be leveraged to apply host DNS settings and policies to Docker DNS traffic. -- Docker Desktop has its own way (different from DNS tunneling) of applying host DNS settings and policies to DNS queries from Docker containers. +- DNS queries from Docker containers managed by Docker Desktop will bypass DNS tunneling. Docker Desktop has its own way (different from DNS tunneling) of applying host DNS settings and policies to DNS queries from Docker containers. +- In order for DNS tunneling to be succesfully enabled, the generateResolvConf option in the wsl.conf file should not be disabled. +- When DNS tunneling is enabled, the generateHosts option in the wsl.conf file is ignored (the Windows DNS hosts file is not copied in the Linux /etc/hosts file). The policies in the Windows hosts file will be applied to DNS queries from Linux, without the need for the file to be copied in Linux. Learn more in the Command Line blog: [WSL September 2023 update](https://devblogs.microsoft.com/commandline/windows-subsystem-for-linux-september-2023-update/#dns-tunneling). diff --git a/WSL/wsl-config.md b/WSL/wsl-config.md index c23160d0..16f34389 100644 --- a/WSL/wsl-config.md +++ b/WSL/wsl-config.md @@ -224,8 +224,8 @@ This file can contain the following options that affect the VM that powers any W | dnsProxy | bool | true | Only applicable to networkingMode = NAT. Boolean to inform WSL to configure the DNS Server in Linux to the NAT on the host. Setting to false will mirror DNS servers from Windows to Linux. | | networkingMode** | string | NAT | If the value is `mirrored` then this turns on mirrored networking mode. Default or unrecognized strings result in NAT networking. | | firewall** | bool | true | Setting this to true allows the Windows Firewall rules, as well as rules specific to Hyper-V traffic, to filter WSL network traffic. | -| dnsTunneling** | bool | false | Changes how DNS requests are proxied from WSL to Windows | -| autoProxy* | bool | false | Enforces WSL to use Windows’ HTTP proxy information | +| dnsTunneling** | bool | true | Changes how DNS requests are proxied from WSL to Windows | +| autoProxy* | bool | true | Enforces WSL to use Windows’ HTTP proxy information | Entries with the `path` value must be Windows paths with escaped backslashes, e.g: `C:\\Temp\\myCustomKernel` @@ -247,6 +247,7 @@ These settings are opt-in previews of experimental features that we aim to make |`sparseVhd`| bool | false | When set to true, any newly created VHD will be set to sparse automatically. | |`useWindowsDnsCache`**| bool | false | Only applicable when `wsl2.dnsTunneling` is set to true. When this option is set to false, DNS requests tunneled from Linux will bypass cached names within Windows to always put the requests on the wire. | |`bestEffortDnsParsing`**| bool | false | Only applicable when `wsl2.dnsTunneling` is set to true. When set to true, Windows will extract the question from the DNS request and attempt to resolve it, ignoring the unknown records. | +|`dnsTunnelingIpAddress`**| string | 10.255.255.254 | Only applicable when `wsl2.dnsTunneling` is set to true. Specifies the nameserver that will be configured in the Linux resolv.conf file when DNS tunneling is enabled. | |`initialAutoProxyTimeout`*| string | 1000 | Only applicable when `wsl2.autoProxy` is set to true. Configures how long (in milliseconds) WSL will wait for retrieving HTTP proxy information when starting a WSL container. If proxy settings are resolved after this time, the WSL instance must be restarted to use the retrieved proxy settings. | |`ignoredPorts`**| string | null | Only applicable when `wsl2.networkingMode` is set to `mirrored`. Specifies which ports Linux applications can bind to, even if that port is used in Windows. This enables applications to listen on a port for traffic purely within Linux, so those applications are not blocked even when that port is used for other purposes on Windows. For example, WSL will allow binding to port 53 in Linux for Docker Desktop, as it is listening only to requests from within the Linux container. Should be formatted in a comma separated list, e.g: `3000,9000,9090` | |`hostAddressLoopback`**| bool | false | Only applicable when `wsl2.networkingMode` is set to `mirrored`. When set to `True`, will allow the Container to connect to the Host, or the Host to connect to the Container, by an IP address that's assigned to the Host. The `127.0.0.1` loopback address can always be used,this option allows for all additionally assigned local IP addresses to be used as well. Only IPv4 addresses assigned to the host are supported. |