Prevent WSL from overwriting DNS settings by setting generateResolvConf = false in /etc/wsl.conf.
Pull active DNS servers from Windows (based on default IPv4/IPv6 routes and interface metrics) using PowerShell, ensuring the most relevant adapters are used.
Write a stable Linux resolver configuration by converting the Windows DNS list into nameserver entries and saving it to /etc/resolv.conf (with CRLF normalization via tr -d '\r').
Top comments (0)