How to Block the Access to Certain Websites on Linux

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 :

Subscribe to my youtube channel for more programming related videos.

www.youtube.com/arjuncodes

--

--

--

Learn Code with Fun.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Code as communication: mental models & expectation management

LibSlack: the C++ library at the foundation of our client application architecture

In a broad topic like DevOps, one of the best ways to get this deliberate practice is not to watch…

Puzzle #19: which egg is the odd one?

Rebuild your legacy platform

Redesign Your Code

My journey with Postman!!

How to become a programmer-programming tips 2020

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Code With Arjun

Code With Arjun

Learn Code with Fun.

More from Medium

chmod and File Permissions

Physical location of files persisted in docker volumes on windows docker-desktop running on…

Creating a VHOST on an Ubuntu Server

Changes made to password.conf file

Install Fragments 2.0 on Ubuntu / Rocky Linux & Fedora