BUILD PROJECT · PI-HOLE
How to Set Up Pi-hole on a Cheap PC
Pi-hole filters DNS requests for devices on your home network. A modest, reliable Linux host is usually enough.
Recovery DNS plan: record the router’s previous DNS values before changing the network, so you can restore them locally if the host is offline.
What Pi-hole does
Pi-hole answers DNS queries for your network and can refuse requests for configured advertising and tracking domains. It is not a firewall, antivirus or guarantee that every advert disappears. Keep a fallback DNS path while testing.
Hardware and prerequisites
Use a supported computer with known storage, working power and a reserved or static LAN address. Wired Ethernet is helpful but must be confirmed on the host. You do not need a powerful CPU or a public address. Record the router’s current DNS settings before changing them.
Install on Ubuntu or Debian
Update the host, then use Pi-hole’s current official installation documentation. Do not paste an unfamiliar script into a privileged shell without reading it. During setup, select the correct interface, upstream DNS provider and an administrator password:
sudo apt update
sudo apt full-upgrade
hostnamectl
ip addressThe final two commands help confirm the hostname and address; they do not configure a reservation for you.
Use Pi-hole as network DNS
First test one device by setting its DNS server to the Pi-hole address. If that works, configure the router’s LAN/DHCP DNS setting so clients receive it automatically. Do not enable two competing DHCP servers. Some routers require Pi-hole to provide DHCP when they cannot advertise a custom DNS server; change that only after recording a recovery plan.
Local DNS and conditional forwarding
Pi-hole can provide local names when configured deliberately. Conditional forwarding can show hostnames from a router’s local domain, but the router address and domain vary. Follow the official documentation and avoid guessing values. IPv6 clients may use router-advertised DNS separately, so test both IPv4 and IPv6 if your network uses them.
Verify and recover
- Open the admin UI from the LAN and confirm queries appear.
- Run a DNS lookup from a test client and compare it with a known fallback resolver.
- If the network loses DNS, restore the old router DNS or temporarily set a client fallback while Pi-hole is repaired.
- Export or back up Pi-hole settings before major changes and keep the admin password in a password manager.
Security and maintenance
Keep the Web UI and DNS service on the local network. Do not expose either directly to the internet. Apply OS and Pi-hole updates, use a unique password and restrict firewall rules to trusted networks. Review blocked domains when a legitimate service breaks instead of disabling filtering everywhere.
Common mistakes and troubleshooting
A changing IP, incorrect interface, IPv6 bypass, router DHCP conflict or a powered-off host can look like “Pi-hole is broken”. Check the client’s received DNS server, the host address, service status and logs one at a time.
Check it worked
hostname -I
resolvectl status
dig example.com @192.0.2.20Replace the example address with the Pi-hole address you recorded. The admin query log should show the test request, and a client should receive the intended DNS server over both IPv4 and IPv6 where your network uses both.
If the internet stops working
Do not factory-reset the router first. Use a client or the router’s local settings to restore the previous DNS values you wrote down. If the router cannot be reached, temporarily set a known fallback resolver on one test device, then check whether the Pi-hole host is powered on, has the expected address, and has a running DNS service. Once access returns, fix one setting at a time and remove the temporary fallback.
Back up and maintain
Export Pi-hole settings before upgrades, keep the admin password in a password manager and store a copy away from the host. Review query logs when a legitimate device fails. Conditional forwarding and local DNS names depend on the router’s domain and address; record those values rather than copying a guess from another network.
What next?
Use the home-lab guide to add SSH and backups, then try Docker or Home Assistant. Find hardware for Pi-hole when you need a separate host.