Skip to content
Go to file
Cannot retrieve contributors at this time
26 lines (21 sloc) 801 Bytes

Edit hosts file to block some websites

Say I want to stop checking Twitter so often. One radical way to do it is by editing /etc/hosts file to add some entries. For instance mine had this content:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##	localhost	broadcasthost
::1             localhost

And I've added these lines (using sudo vi hosts as I needed write permission):

After this, I've typed sudo killall -HUP mDNSResponder to flush my Mac's DNS cache, so it doesn't get confused by the changes I've made to the hosts file.