I would like to restrict some websites to be surfed. I mean I want to prevent access to some websites. Please guide me on how to do the same in Ubuntu 14.04 LTS.
The easiest way, which works system-wide, is to set up entries in /etc/hosts
For example, add the following lines to the end of /etc/hosts, one for each site you want to block:
This tells the system's DNS resolver "please override the name to IP resolution for these host names" and since it overrides it to 127.0.0.1, those sites won't work.
Note that it is possible for users to circumvent this by using an HTTP proxy in the browser or if they were somehow to use an alternative DNS resolver, or if the site accept connections based on IP address only, and so on.
Open a terminal, and type
You should now see
To save, press
It's as simple as that!
Note: I have NOT come up with this answer. I just made it more simple for the newbies. All credits go to you, @neon_overload.
Best way for blocking and allowing sites
Url Blocking :
your website ip and press tab type your ur website
go to Terminal and type
deny all sites (