PiHole
How to set up a PiHole
An install guide by Kyle
Using a Raspberry Pi as the networks DNS server, Pi-Hole “blocks ads for all your devices without the need to install client-side software. The Pi-hole blocks ads at the DNS-level, so all your devices are protected.”1) This also allows ad blocking on devices which do not support it (think mobile/tablet)
Install Guide
This guide has been tested using Raspbian Jessie, macOS Sierra 10.12.3 & PiFiller 1.3 and works.
Requirements
MicroSD card (min 4GB)
MicroSD card reader to USB depending on your computer
A way to burn images onto SD card - I choose PiFiller for macOS
Raspberry Pi with a power cable, monitor (just for install set up, can be run headless later), keyboard for initial input, - Ethernet cable to connect the RPi to the router, Wi-Fi adapter for RPi
Access to administration panel on the router (this information is typically next to the SSID on the bottom of the router)
Initial things
Download latest Raspbian Jessie image
Burn this image to the SD card using PiFiller for macOS. You can optionally use dd or another method to burn it. PiFiller is the fastest and easiest way I have found to do it.
Attach Raspberry Pi to monitor & keyboard, connect via Ethernet to the router and insert the SD
Then power on. If its done in a different order it can fall over.
Configuring the Raspberry Pi
Check you are connected to the internet (ping 8.8.8.8 is easy way to check, this is Google’s DNS server so if thats down today will be a bad day)
Update the Pi using
sudo apt-get update -y
Optional: install a different text editor, nano is installed by default.
sudo apt-get install vim -y
Configure a static IP address to allow headless use of the Pi
run route -ne and note the default gateway IP address (routers IP address)
Now we need to edit the dhcpcd.conf file using
sudo vim /etc/dhcpcd.conf
The following information needs to be added to the bottom of the file:
sudo reboot
will allow all changes to take effectTo check it has worked run
ifconfig
and eth0 should be assigned 192.168.0.88 (or whatever you chose)Enabling SSH: this is on by default on the Raspberry Pi - if it is not working run
sudo raspi-config
and enable it in the advanced > ssh menu.Generate SSH-Keys to allow passwordless entry - this is an easy to follow guide
Optional: create a bash alias in
.bash_profile
to allow easy entry. I addedalias pihole='ssh pi@192.168.0.88
' so logging into PiHole is as easy as just typing it into terminal.
Installing & Testing
Install guide on their GitHub is best
Run sudo curl -sSL https://install.pi-hole.net | bash
The Web interface will be installed automatically so you can view stats and change settings. You can find it at:
http://192.168.1.x/admin/index.php
orhttp://pi.hole/admin
The install covers it all, its very easy to do, remember and note the admin password produced.
Misc
The default credentials for the Raspberry Pi is username: pi
& password: raspberry
Deploying on Devices
You cannot edit the DNS servers on the Virgin HomeHub and after searching around it also seems to be the same for Sky, BT and other broadband providers. DNS servers must be modified on devices on the network.
iOS
Settings > Wi-Fi > “Networking Name” > DNS
(192.168.0.88 in this example)
Android
Settings > Long press on the Network Name > Manage Network Settings > Show Advanced Options > DNS 1
macOS
System Preferences > Network > Advanced > DNS Tab > +DNS Server
Windows 10
.
Network and Sharing Centre > Click on the connection type > Properties > Internet Protocol Version 4 (TCP/IPv4) > Properties > Select “Use the following DNS server addresses”
and add in the IP address of the Pi
Last updated