[SOLVED] How to block game servers

What is the best approach for blocking game servers like Fortnite and Valorant? My son likes to play and tends to go over his time allotment.

My thinking is that blocking it via Pi-hole would work great where I can disable Pi-hole for the allowed period of time, after which Pi-hole begins blocking again. Would that work as I'm thinking or is there some other way I should be approaching this?

Is there a good methodology for harvesting server addresses?

Thanks in advance!

How to find the domains to block

ADD

Time-based blocking is not implemented (yet). But you can do this via cron or manual scripts, e.g.

1 Like

Fantastic! Thank you!

Just to follow up on this quickly, disabling Pi-hole for say, 1 hour, won't allow him to play for an hour before he gets booted?

Disabling Pi-hole for a certain amount of time will unblock everything.

So for my purposes, rather than a crontab (my son doesn't play his games on a regular schedule), a script that disables the blocklist and then re-enables it an hour later would do the same trick.

Use something like pihole disable 60m in your script then.

As yubiuser pointed out already, you should be aware that this will disable ALL blocking for ALL clients for the specified time.

The linked crontab solution would allow to disable it just for one client (if group management in Pi-hole is configured accordingly).

Wouldn’t I be able to use the first command in the crontab, a sleep 1h and then the second command in the crontab?

Sorry, can not follow you here. Which commands are you referring to?

Sorry, from your second link:

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

But running each line in a bash script separated by a sleep 1h.

This could work.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.