Although @smw 's answer looks like it might be your solution, there's nothing quite like "rolling your own" - if only for the satisfaction.
Building on my comment above, I am assuming that you can create a /etc/hosts file that gives you the permissions that you want. I am going to call them, as above,
playtimeHosts. Now you need a script to set one or the other as the active file. This assumes that you have moved your /etc/hosts out of the way...
Create one script:
ln -s /etc/worktimeHosts /etc/hosts
save it as
/usr/bin/getWorking, set permissions to execute
chmod 755 /usr/bin/getWorking
Now create a second script:
ln -s /etc/playtimeHosts /etc/hosts
save it as
/usr/bin/getPlaying, set permissions as before
You have to make sure you have permission to do these things to files in /etc...
Now edit the
cron table (see for example here)
Add a line like this:
00 00 08 * * /usr/bin/getWorking
And another line like this:
00 00 17 * * /usr/bin/getPlaying
I think that will be close to a solution - but I haven't tested this, so play with it and find my errors...