The desktop problem is pretty solvable for programmers. I wrote a simple bash script to add/remove blocked sites to /etc/hosts. I mapped that script to aliases 'focus' and 'distract' that block and unblock sites, respectively (requiring the root password). Finally, I set up a root cron job that runs 'focus' every hour during desired time windows (for me that's morning until late evening on Mon-Sat inclusive).
That system works exceedingly well, but I can't port it to iOS.
Right now I use Lockdown (VPN-based) with a block list and it works okay, except when I want to unlock by disabling the firewall. There's no automatic reenable option making the whole system less effective. I considered writing my own VPN-based system but haven't got around to it. Would love to see Motion tackle it.