Skip to content

Instantly share code, notes, and snippets.

@brian-pickens
Last active January 18, 2024 13:41
Show Gist options
  • Save brian-pickens/b4b59cad550eaf8b7b922d26859d605f to your computer and use it in GitHub Desktop.
Save brian-pickens/b4b59cad550eaf8b7b922d26859d605f to your computer and use it in GitHub Desktop.
This is how I fixed my DNS issues in WSL and Docker Desktop for Windows

Fixes I found

Update /etc/wsl.conf

In the network section, set generateResolvConf = false like so:

[network]
generateHosts = true
generateResolvConf = false

Update /etc/resolv.conf

Set the nameserver to 8.8.8.8 like so:

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 8.8.8.8

Issues over VPN

update the file /etc/resolv.conf and add your organization DNS server as a new nameserver. Should look like this:

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver x.x.x.x (org/vpn dns server here)
nameserver 8.8.8.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment