Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ram0973/75062f09d5f90d06dd7e12859a9757bd to your computer and use it in GitHub Desktop.

Select an option

Save ram0973/75062f09d5f90d06dd7e12859a9757bd to your computer and use it in GitHub Desktop.

Revisions

  1. @coltenkrauter coltenkrauter revised this gist Oct 17, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fix-wsl2-dns-resolution
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ 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 lines in the 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

  2. @coltenkrauter coltenkrauter revised this gist Oct 17, 2019. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions fix-wsl2-dns-resolution
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,16 @@
    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 lines 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
  3. @coltenkrauter coltenkrauter revised this gist Oct 17, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion fix-wsl2-dns-resolution
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    1. Create a file: /etc/wsl.conf.
    2. Put the following lines in the file
    2. Put the following lines in the file in order to ensure the your DNS changes do not get blown away
    ```
    [network]
    generateResolvConf = false
  4. @coltenkrauter coltenkrauter created this gist Oct 17, 2019.
    14 changes: 14 additions & 0 deletions fix-wsl2-dns-resolution
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    1. Create a file: /etc/wsl.conf.
    2. Put the following lines in the file
    ```
    [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 lines 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