-
-
Notifications
You must be signed in to change notification settings - Fork 46
07 Pi‐Hole for Domain Blocking
Code al Dente edited this page Jun 20, 2024
·
1 revision
To ensure that the blocklist from the GitHub repository is always up-to-date, you can add the list directly to Pi-Hole's adlists and configure it to update automatically. Here’s a step-by-step guide:
- Open your web browser.
- Navigate to the Pi-Hole admin interface. This is usually at
http://pi.hole/admin
orhttp://<IP_ADDRESS>/admin
, where<IP_ADDRESS>
is the IP address of your Pi-Hole server. - Log in with your admin password.
- Visit the GitHub repository to locate the blocklist URL.
- Copy the raw URL of the
block.txt
file. It should look something like this:https://raw.githubusercontent.com/Bon-Appetit/porn-domains/master/block.txt
- In the Pi-Hole admin interface, go to Group Management > Adlists.
- Click on the Add a new adlist field and paste the copied URL.
- Optionally, add a description for easy identification, such as "Porn Domains Blocklist."
- Click Add to save the new adlist.
- In the Pi-Hole admin interface, go to Tools > Update Gravity.
- Click Update to apply the new adlist immediately.
- Pi-Hole automatically updates its gravity list once a week by default. To ensure more frequent updates, you can adjust the cron job settings.
- Access the Pi-Hole server via SSH. Use a terminal or SSH client to connect to your Pi-Hole server:
Replace
ssh pi@<IP_ADDRESS>
<IP_ADDRESS>
with the IP address of your Pi-Hole server. - Edit the cron job settings:
sudo nano /etc/cron.d/pihole
- Modify the update frequency as needed. For example, to update daily at midnight, you can add:
0 0 * * * root PATH="$PATH:/usr/local/bin/" pihole updateGravity > /dev/null
- Save the changes and exit the editor (Ctrl + X, then Y, and Enter).
- Return to the Pi-Hole admin interface.
- Go to Query Log.
- Check if the domains from the blocklist are being blocked as expected.
- Regularly check the GitHub repository for any changes or updates to the blocklist URL.
- Ensure your Pi-Hole server is running smoothly and the updates are applied as scheduled.
By following these steps, Pi-Hole will automatically update and use the blocklist from the GitHub repository, ensuring that your network is always protected from unwanted content.
Note
AI-Content included: This article contains content generated with assistance from ChatGPT, an AI language model developed by OpenAI.