Firstly aplogies if I'm not doing this correctly
Title timed DNS queries
Block DNS based on time
We have broadband which is limited during the day, and unlimited at night
We currently block apple update servers all the time
Would be helpful to have a special list call it a grey or yellow list
Which would block always except for certain times
I would propose having a general time setting and allowing domains to be turned on /off on the fly
I am a developer so would be happy to help implement , I have a number of pis to test on, plus a Turris omnia router.
I have not implemented this feature as such but I believe that you could use xinetd (--libwrap) and allow incoming UDP/TCP calls based on time and block others. Then, dnsmasq will be used only during the allowed time period.
My - potential - solution relates to stop and prevent use of dnsmasq services after certain time completely. Hence it is not relevant to the poster's message. Based on your answer, I saw my misunderstanding.
Note that this is trivial with group management. You can simply add a group with all the domains you want to block and keep it disabled. Now, prepare a cron job to enable/disable this group at the times you want. This can conveniently do this for an entire set of domains which stays comfortably manageable through the web page of Pi-hole.
For the exact same reasons described in the solution post (block access to anything else but the school activities during a certain period), it would be nice to be able to more easily define a ruleset for such behavior.
Maybe something like this; rules may be matched sequentially; first one that matches provides the action; then global allow/block lists may apply.
We need to have this in the native UI (without hacks).
It could be a few basic features added and we would be there. Like...
"Apply Blacklist to Group - during time frame"
-- only allows specific sites be contacted, perfect for home school so older kids who need larger freedom to do research, etc but stop them from going to YouTube or game sites during school hours, or on dedicated 'school devices'
"Block all Group activity - during time frame"
-- no internet allowed, perfect for limiting kids device use and home school
"Apply Whitelist to Group - during time frame"
-- only allows specific sites be contacted, perfect for home school