Nameserver 8.8.8.8 # Or use your DNS server instead of 8.8.8.8 which is a Google DNS server If it exists, replace existing one with this new file. Put the following lines in the file in order to ensure the your DNS changes do not get blown away.Get-NetAdapter | ? | Set-NetIPInterface -InterfaceMetric 6000 Get-NetAdapter -InterfaceDescription 'Cisco An圜onnect*' | Get-DnsClientServerAddress | Select -ExpandProperty ServerAddresses mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command ' Re-enable auto generation of nf (if disabled)īy commented the disable with # sudo nano /etc/wsl.confĬreate the script sudo nano /bin/vpn-dns.shĮcho 'Getting current DNS servers, this takes a couple of seconds' This is just the first part of his solution updating nf when starting WSL. This solution is automatic and was created by EdwardCooke (see ). So here is a workaround for these problems. Plus there is a issue with the Cisco An圜onnect. There is an issue with DNS Forwarding in WSL2 when using VPN ( see github Issue).