Skip to content

Instantly share code, notes, and snippets.

@jimklimov
Created September 12, 2022 08:55
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 jimklimov/415520de733e9ec2d159aff944c4fcb2 to your computer and use it in GitHub Desktop.
Save jimklimov/415520de733e9ec2d159aff944c4fcb2 to your computer and use it in GitHub Desktop.
Fix for WSL2 lacks internet DNS
#!/bin/sh
# Add as /etc/rc3.d/S99dns
if grep -q -E '^nameserver 8.8.8.8' /etc/resolv.conf ; then exit 0 ; fi
if [ "$1" = start ]; then
mkdir -p /run/resolvconf/ && echo 'nameserver 8.8.8.8' >> /etc/resolv.conf
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment