Skip to content

Instantly share code, notes, and snippets.

@colhountech
Created January 20, 2021 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colhountech/f5b72050dd30be2a24453711f97dace5 to your computer and use it in GitHub Desktop.
Save colhountech/f5b72050dd30be2a24453711f97dace5 to your computer and use it in GitHub Desktop.
1. Create a file: /etc/wsl.conf.
2. Put the following lines in the file in order to ensure the your DNS changes do not get blown away
[network]
generateResolvConf = false
3. In a cmd window, run wsl --shutdown
4. Restart WSL2
5. Create a file: /etc/resolv.conf. If it exists, replace existing one with this new file.
6. Put the following line in the file
nameserver 8.8.8.8 # Or use your DNS server instead of 8.8.8.8 which is a Google DNS server
7. Repeat step 3 and 4. You will see git working fine now.
Credit: https://github.com/microsoft/WSL/issues/4285#issuecomment-522201021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment