Skip to content

Instantly share code, notes, and snippets.

@krnaveen14
Last active July 16, 2024 04:55
Show Gist options
  • Save krnaveen14/84cba6e30b952abc50673741f2fcb998 to your computer and use it in GitHub Desktop.
Save krnaveen14/84cba6e30b952abc50673741f2fcb998 to your computer and use it in GitHub Desktop.
Fix for WSL2 No Internet
# Open Windows Command Prompt
# Find DNS nameserver used by Windows
# 10.9.8.169 is the DNS Server in my system (Corporate Device / Network)
# Use 8.8.8.8 if the DNS Server is empty
ipconfig /all | findstr /R "DNS\ Servers"
# Go to WSL
# Set nameserver in /etc/resolv.conf
sudo bash -c "echo 'nameserver <dns_server_from_prev_cmd>' > /etc/resolv.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment