Table Of Contents
This post shows how to install Pi-hole on a raspberry Pi 3 B.
Pi-hole is used to block unwanted queries and URLs that you do not want to load on the network. it protects you from trackers and optimizes the traffic of your network.
▪ Raspbian installation and update/upgrade packages
First, flash your disk SD from Etcher or other app.
Here is Raspbian Stretch 2017-09-07 Lite
Wait minutes.. and is complete !
Connect your setup for update and install new packages.
sudo apt update -y && sudo apt upgrade -y
Wait good minutes .. during this time drink a good cappuccino.
Install curl :
sudo apt install curl
You can clone from the repo of Pi-hole or directly curl with this command :
curl -sSL https://install.pi-hole.net | bash
When ask you if you want install on your raspberry and put in static IP, check yes.
Then choose your preferred DNS. You can then change it and put several.
You can select blocklists ads :
It will also ask you if you want a web panel, I strongly recommend you to leave validated so that you can from anywhere in the local network connect to the raspberry with a password and manage your DNS/blacklist and have your statistics.
As soon as you finish installing Pi-hole, it will give you the localhost address and the password generated.
For edit the password :
sudo pihole -a -p
This is a preview of the panel when you are connected 🎉
The dark theme is edited by me, you can found at this repository.
☕ | Check my Twitter account. You can see many projects and updates. You can also support me on Buy Me a Coffee, Stripe or GitHub Sponsors. Thanks for read my post ! 🤩 |
---|
Top comments (6)
Any practical tips on using it with router that doesn't allow me to change DNS address?
Point your DNS to your IP router, if the router is in the default configuration with a DNS of your ISP, it will help you.
oh sorry, I don't get it. Router is with default config with a DNS provider and I can not change it. I understood that to use PiHole I should set it up on RaspPi and point my DNS router settings to it. Did I get everything completely wrong? Thanks
Two methods :
1) If you cannot change the DNS on your router/ISP, you can do it on your Pi Hole very easily. Just put it between your network of computers (clients) and the router so that it is affected.
You can change DNS on your Pi Hole with the webpanel (RaspberryPi-IP/admin/settings.php?...) and restart dnsmasq for affect the change.
In order for your PC to go through the DNS you entered in the Pi Hole, you must then point your DNS from your computer to the IP address of your Pi Hole.
Do not hesitate to put a second IP DNS in case, because if you change local network or the raspberry Pi is disfiguring, you will not be able to access the internet.
2) Put your Pi Hole an router, enable DHCP (RaspberryPi-IP/admin/settings.php?...) and well done !
Thanks for explaining in details. There would be following inconvenience in this case:
typically we connect to our home routers via LAN, WiFi from different devices (laptop, PC, tablet, phone). With constellation like this we would need to configure every of these client devices separately no?
Cheers
Exactly ! On my device or my PC, I must edit DNS only if i use Pi Hole for a gateway between clients and router. :|