This tutorial will build a Pi-hole server running on a Raspberry Pi 3. Pi-hole enables network-wide adblocking. Pi-hole is your own personal DNS Server and will not only protect your network from ads, but also from malicious websites, all the while improving page load performance. You will be able to access the Pi-hole via a web interface, and also manage the Raspberry Pi unit via SSH.
Hardware Required:
- Raspberry Pi 3
- 4GB+ microSD card
- Ethernet
- Monitor connected via HDMI
- Keyboard
Step 1: Getting the Raspberry Pi up and running
Unzip the image
Download Etcher https://github.com/balena-io/etcher/releases/download/v1.4.8/balenaEtcher-Setup-1.4.8-x64.exe
Flash the image to the microSD card (use a 4GB card or larger)
Connect keyboard and monitor and power to Raspberry Pi
Boot up
https://www.raspberrypi.org/documentation/linux/usage/users.md
Log in using
pi
passwd
Change password using: passwd
ifconfig
Write down the MAC address
If possible, assign the Raspberry Pi a static IP from within your router/firewall
Download Etcher https://github.com/balena-io/etcher/releases/download/v1.4.8/balenaEtcher-Setup-1.4.8-x64.exe
Flash the image to the microSD card (use a 4GB card or larger)
Connect keyboard and monitor and power to Raspberry Pi
Boot up
https://www.raspberrypi.org/documentation/linux/usage/users.md
Log in using
pi
passwd
Change password using: passwd
ifconfig
Write down the MAC address
If possible, assign the Raspberry Pi a static IP from within your router/firewall
Reset the Raspberry Pi so that the device gets
assigned the new IP address from the router/firewall
ifconfig
confirm the IP is correct
Step 2: Installing Pi-hole
https://github.com/pi-hole/pi-hole/#one-step-automated-installFrom Raspberry Pi's CLI, enter the following commands:
wget -O basic-install.sh https://install.pi-hole.net
sudo bash basic-install.sh
This will bring up the GUI to install Pi-hole. Use all of the default recommended settings.
Write down the password that is generated. This will be used to log into the web admin interface.
Step 3: Enabling SSH
https://www.raspberrypi.org/documentation/remote-access/ssh/
From Raspberry Pi's CLI:
Enter sudo raspi-config in a terminal window
Select Interfacing Options
Navigate to and select SSH
Choose Yes
Select Ok
Choose Finish
Alternatively, use systemctl to start the service
sudo systemctl enable ssh
sudo systemctl start ssh
From Raspberry Pi's CLI:
Enter sudo raspi-config in a terminal window
Select Interfacing Options
Navigate to and select SSH
Choose Yes
Select Ok
Choose Finish
Alternatively, use systemctl to start the service
sudo systemctl enable ssh
sudo systemctl start ssh
Step 4: Configuring Pi-hole from web admin interface
Go to another computer/device connected to the same network
Open a browser
Open a browser
Visit the IP address of the Pi Hole device
Begin configuring Pi-hole.
Step 5: Set up Router's DNS settings to point to Pi-hole
Log
into your Router
Change
the DNS to point to the IP address of Pi-hole
Reboot
all client machines to update their DNS server
Please consider making a donation to Pi-hole to support the development: https://www.patreon.com/pihole
Please consider making a donation to Pi-hole to support the development: https://www.patreon.com/pihole