Steps:

  • Create /etc/wsl.conf (if it doesn’t already exist)
  • Add the following:
[network]
generateResolvConf = false
  • Shutdown from powershell (wsl --shutdown), then reopen
  • Edit /etc/resolv.conf: nameserver [pi-hole ip]
  • Restart subsystem again. Verify /etc/resolv.conf still exists.
  • Verify with dig or nslookup