Configure Updates and Network-Level Blocking
Update the Pi-hole’s OS, software, and lists with:
sudo apt update && sudo apt upgrade -ypihole -up -ysudo /usr/local/sbin/pihole-updatelistsCreate a Script to Update the Pi-Hole and Lists Automatically
Section titled “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:
Terminal window touch ~/.pi-hole-update.sh -
Edit the file to include:
~/.pi-hole-update.sh #!/bin/zshsudo apt update && sudo apt upgrade -ypihole -up -ysudo /usr/local/sbin/pihole-updatelistsIf you’re using Bash instead of Zsh, replace
#!/bin/zshwith#!/bin/sh. -
Add a new cron job that runs the script every Sunday morning at 03:00. Edit
/etc/crontabto add this line:/etc/crontab 0 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):~/.zshrc alias update!='. ~/.pi-hole-update.sh'
Configure the Omada Controller to Enable Network-Wide Blocking with Pi-Hole
Section titled “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 select the site’s name.
- Select the Settings cog then Wired Networks and select 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.1to use Cloudflare’s DNS as a backup.