# Pi-hole on a Raspberry Pi: block ads for your whole house From @tommy_lee_harvey. About 20 minutes. ## You need - A Raspberry Pi (a 3, 4, 5 or Zero 2 W is plenty), a power supply, a microSD card (8 GB+) - Your router's admin page (usually 192.168.0.1 or 192.168.1.1) ## 1. Flash the Pi 1. Install **Raspberry Pi Imager** on your computer. 2. Choose *Raspberry Pi OS Lite (64-bit)*. 3. Click the gear / "Edit settings": set a hostname (`pihole`), a username and password, your Wi-Fi, and **enable SSH**. 4. Write the card, put it in the Pi, power it on. Give it 2 minutes. ## 2. Log in and update ```bash ssh youruser@pihole.local sudo apt update && sudo apt full-upgrade -y ``` ## 3. Give the Pi a fixed address In your router, find the Pi under DHCP / connected devices and set a **DHCP reservation** (a fixed IP, for example 192.168.1.50). Reboot the Pi so it picks it up: `sudo reboot`. ## 4. Install Pi-hole ```bash curl -sSL https://install.pi-hole.net | bash ``` Accept the defaults. Write down the admin password at the end (change it any time with `pihole setpassword`). ## 5. Point your network at it In the router's DHCP / LAN settings, set the **DNS server** to the Pi's IP (192.168.1.50). Save. Phones and laptops pick it up when they reconnect to Wi-Fi. ## 6. Check it works Open `http://192.168.1.50/admin`, log in, and watch the "Queries blocked" number climb. ## If something breaks - A site won't load: in the admin page go to *Query Log*, find the blocked domain and click **Allow**. - Turn blocking off for 5 minutes: `pihole disable 5m`. - Undo everything: set the router's DNS back to "automatic".