Install Pi-Hole on Windows 10 Via WSL
#Pi-Hole #WSL #AdBlocker
Full steps can be found at https://i12bretro.github.io/tutorials/0335.html
--------------------------------------------------------------------
Installing WSL
--------------------------------------------------------------------
01. Log into the Windows 10 device
02. Launch PowerShell as administator by right clicking the Start button ≫ search power ≫ Right click on Windows PowerShell ≫ Run as Administrator
03. Run the following command to install WSL
# install WSL
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# reboot the system
Restart-Computer -Force
04. If running Windows 2004 or newer, run the following additional commands to use WSL 2
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
05. After the device reboots, download the PiHole for WSL installer script https://github.com/DesktopECHO/Pi-Hole-for-WSL1/raw/master/PH4WSL1.cmd
06. Right click the downloaded .cmd file ≫ Run as Administrator
07. Press Enter to accept the default install location (C:\Program Files)
08. Press Enter to continue with the installation
09. When prompted, enter and confirm a Pi-Hole admin password
10. After the Pi-Hole installation script completes, right click the Start button ≫ run ≫ type cmd ≫ Press Enter
11. Run the following commands in command prompt
# enter wsl prompt
wsl
# edit resolv.conf
sudo nano /etc/resolv.conf
12. Add the following line
nameserver 127.0.0.1
13. Press CTRL+O, Enter, CTRL+X to write the changes to resolv.conf
14. Run the following command to update the Pi-Hole blocklist
# update pihole
sudo pihole -g
15. Open a web browser and navigate to http://localhost/admin
16. Click Login
17. Authenticate with the admin password set earlier
Special thanks to the developer of this installation script https://github.com/DesktopECHO/Pi-Hole-for-WSL1
### Connect with me and others ###
★ Discord: https://discord.com/invite/EzenvmSHW8
★ Reddit: https://reddit.com/r/i12bretro
★ Twitter: https://twitter.com/i12bretro