Last active
July 16, 2024 04:55
-
-
Save krnaveen14/84cba6e30b952abc50673741f2fcb998 to your computer and use it in GitHub Desktop.
Fix for WSL2 No Internet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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