For Macs, there's SelfControl: https://selfcontrolapp.com
It automates editing the hosts file and flushing DNS caches. It can operate as a whitelist or a blacklist.
It automates editing the hosts file and flushing DNS caches. It can operate as a whitelist or a blacklist.