Skip to content

Customized pihole docker image to schedule blocking & allowing certain domains. Also includes a more extensive domain blacklist by default.

License

Notifications You must be signed in to change notification settings

iloveitaly/pihole-scheduled-blocking

Repository files navigation

PiHole With Scheduled Blocking

As part of my digital minimalism kick I wanted to automatically block websites in my home. This docker image extends the default pihole image to provide a mechanism to automatically block and allow websites based on a schedule.

It also blocks DNS over HTTPS, blocks a wider array of sites by default (porn, gambling, malware, etc), and allows alexa to work even if you schedule amazon.com to be blocked.

DNS is configured to use Quad9.

Usage

Best way to use this is via docker-compose. Here's an example docker-compose.yml file.

Here's the image on docker hub.

Note that if you update the image you may need to remove the volume completely if you are using docker-compose.yml. This is because we mount /etc to a volume and if the image update assumes a fully-updated /etc you will run into weird issues.

Manual Override

In some scenarios, the block/allow scripts may glitch out and leave your blocking in an undesired state. Here's how to manually run a command to fix this:

docker compose exec pihole ./allow.sh

Customization

  • You can override the blocklist file
  • You can override the whitelist file
  • Check out the ENV definitions in the Dockerfile to customize the cron schedule

Development

Some helpful commands are included in the Dockerfile. Most of the magic happens in install.sh

About

Customized pihole docker image to schedule blocking & allowing certain domains. Also includes a more extensive domain blacklist by default.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project