# Domain block timeout

**URL:** <https://discourse.pi-hole.net/t/domain-block-timeout/59890>\
**Category:** Customizing Pi-hole\
**Created:** [December 17, 2022, 10:45pm UTC](https://discourse.pi-hole.net/t/domain-block-timeout/59890 "2022-12-17T22:45:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![chrislph](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/chrislph/32/32723_2.png) [@chrislph](https://discourse.pi-hole.net/u/chrislph)\
**Post date:** [December 17, 2022, 11:53pm UTC](https://discourse.pi-hole.net/t/domain-block-timeout/59890/2 "2022-12-17T23:53:55Z")

</div>

This looks like a similar open feature request which is here

> [@Timer for Groups to re-enable blocking?](https://discourse.pi-hole.net/t/timer-for-groups-to-re-enable-blocking/37469):
>
> Right now there's a really convenient feature to disable Pihole for 10s/30s/5m. Is it possible to disable Pihole per group? Quite often I need to disable just a few devices on the network for short periods of time, for example playing some games. But often forget to restart the blocking.

If you're up for a bit of hacking, this can be achieved today using Pi-hole's Groups and some scripting.

- In _ **Groups** _ create a new group called Focus
- In _ **Domains** _ create new blacklist rules for the social media and other websites to block access
- Edit these blacklist rules and change them to just the new Focus group (no longer in Default)
- In _ **Clients** _ find your computers and click Add and change their group so they are in both Default and Focus groups

If the Focus group is turned off you get all the normal blocking from Default but not the social media. If the Focus group is turned on you get the blocking in Default plus the extra blocking from Focus.

Test this manually to make sure it's working as intended.

Finally, you can schedule the turning on and off of the Focus group using cron. You have to know how crontab entries are formatted – [this reference](https://www.adminschoice.com/crontab-quick-reference) will help.

Open crontab for editing

```
crontab -e

```

Add in your lines, eg to turn on Focus (block social media) at 9am and turn it back off (enable social media) at midday every day of the week:

```plaintext
#Enable Focus:
0 9 * * * sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=1 where name='Focus';"; /usr/local/bin/pihole restartdns reload-lists &>/dev/null
#Disable Focus:
0 12 * * * sudo sqlite3 /etc/pihole/gravity.db "update 'group' set 'enabled'=0 where name='Focus';"; /usr/local/bin/pihole restartdns reload-lists &>/dev/null

```

Save your edits and quit the editor. Now the Focus group will be turned on and off automatically according to the schedule you specified.

---

_[View the full topic](https://discourse.pi-hole.net/t/domain-block-timeout/59890)._
