Configure Updates and Network-Level Blocking
Updates
Update the Pi-hole's OS, software, and lists with:
sudo apt update && sudo apt upgrade -y
pihole -up -y
sudo /usr/local/sbin/pihole-updatelists
Create a Script to Update the Pi-Hole and Lists Automatically
Put the update commands into a script so that you can run it from cron and assign it an alias. This gives you a central location from which to maintain the commands that run:
-
Create the script:
touch ~/.pi-hole-update.sh
-
Edit the file to include:
~/.pi-hole-update.sh#!/bin/zsh
sudo apt update && sudo apt upgrade -y
pihole -up -y
sudo /usr/local/sbin/pihole-updatelistsIf you're using Bash instead of Zsh, replace
#!/bin/zsh
with#!/bin/sh
. -
Add a new cron job that runs the script every Sunday morning at 03:00. Edit
/etc/crontab
to add this line:/etc/crontab0 3 * * * 0 pi ~/.pi-hole-update.sh
-
To run the updater script whenever you want, create an
update!
alias. Add this line to~/.zshrc
(or if you're using Bash, to~/.bashrc
):~/.zshrcalias update!='. ~/.pi-hole-update.sh'
Configure the Omada Controller to Enable Network-Wide Blocking with Pi-Hole
Configure the Omada controller and set the DNS server to use the Pi's IP address.
- Log in to the controller and click the site's name.
- Click the Settings cog then Wired Networks and click the edit icon for the network name that should use the Pi-hole.
- Next to DHCP Server, select ☑ Enable to expand the DHCP options.
- Next to DNS Server, select Manual and enter the Pi-hole's IP address into the first box. In the second box, enter
1.1.1.1
to use Cloudflare's DNS as a backup.