Block access to websites on a Mac using hosts file
In this tutorial I will show you how to block access to specific website without using any external application.
For example :
Lets say we want to block outgoing connections for adobe application and we have the following sites that we want to block
So these method is the best way to block these sites.
How to do that ???
1- Open up your Terminal and type the following (You’ll be asked for your root password because this is a system file):
sudo nano /etc/hosts
2- This will bring up a screen that looks a lot like the one below, notice that “activate.adobe.com” has been added at the bottom as a site we want to block. To block any other site, simply type it in the same fashion. You can have as many sites map to 127.0.0.1 as you want:
Now save the file in nano by hitting control + o and the return key.
Note that you may need to run the following command for changes to take effect:
sudo dscacheutil -flushcache