How to Block the Access to Certain Websites on Linux
Oct 27, 2021
By:Arjun Gautam
We can block the access to certain websites on linux as shown in picture below , facebook.com is refused to connect while youtube.com is opening in other tab.
Step : 1
Open /etc/hosts in text editor (gedit in my case) with sudo privilege as show in below diagram .
Step 2 :
You will get the text editor like this :
Step 3 :
Now add websites you want to block using
127.0.0.1 www.facebook.com
127.0.0.1 www.p*rnhub.com and so on .
Step 4 :
Step : 5
Save the file , And you are done .
Don’t forget to follow me on Medium
Subscribe to my youtube channel for more programming related videos.