Skip to content

Instantly share code, notes, and snippets.

@dp0613
Created November 22, 2022 12:40
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 dp0613/5a3060236e13b73d49f5823eb2c7a385 to your computer and use it in GitHub Desktop.
Save dp0613/5a3060236e13b73d49f5823eb2c7a385 to your computer and use it in GitHub Desktop.
Fix docker lookup no such host - Work on both Linux and Windows WSL
# List your network interfaces
$ ip a

# Add Netplan config file and edit as below 
# REMEMBER edit your eth0 name according to your network interface
$ sudo nano /etc/netplan/01-docker.yaml

# If on linux
$ sudo netplan apply

# If on windows WSL
$ wsl --shutdown
network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 172.17.2.5/20
      gateway4: 172.17.15.255
      nameservers:
        addresses:
        - 1.1.1.1
        - 1.0.0.1
        - 2606:4700:4700::1111
        - 2606:4700:4700::1001
        search: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment