microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.54k stars 823 forks source link

DNS resolver sets TTL for all answers to `0` #9423

Open oliversalzburg opened 1 year ago

oliversalzburg commented 1 year ago

Version

Microsoft Windows [Version 10.0.19044.2075]

WSL Version

Kernel Version

5.10.102.1-microsoft-standard-WSL2

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

dig -x 1.1.1.1 +noall +answer

Expected Behavior

Sub-second response from the DNS resolver on my LAN. On second execution, near-instant response below ~50ms from local DNS cache.

Actual Behavior

The WSL DNS resolver is very slow and it replaces the TTL with 0, causing all future requests to go through the same, slow process.

Diagnostic Logs

$ # Local Resolver
$ dig -x 1.1.1.1 @172.22.176.1 +noall +answer
1.1.1.1.in-addr.arpa.   0       IN      PTR     one.one.one.one.

$ # Google DNS
$ dig -x 1.1.1.1 @8.8.8.8 +noall +answer
1.1.1.1.in-addr.arpa.   1006    IN      PTR     one.one.one.one.
CatalinFetoiu commented 1 year ago

Hi. Please try enabling the experimental "dnsTunneling" feature and let us know if it fixes the issue.

You can find more details at https://devblogs.microsoft.com/commandline/windows-subsystem-for-linux-september-2023-update/

oliversalzburg commented 1 year ago

@CatalinFetoiu

Please note this feature is currently only available to Windows Insiders canary and Release Preview Channel with the latest Windows 11

I don't have that. I feel like my example should be enough for others to verify if the behavior changed at all.

ashemedai commented 7 months ago

No Windows 11 systems here, but indeed having broken TTL with drill on Debian 12 on my (multiple) Windows 10 WSLs.