Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Your post seems somewhat hostile, at least the the bold lettering may imply it.
I believe that jlinkels's apparent hostility was not directed to you, and that he wasn't actually referring to your comment (which fully makes sense), but to the OP's vague formulation of his/her question. In fact the LQ netiquette does recommend that questions respect a few criteria, which the OP apparently didn't consider, but of which he has now been made aware.
Last edited by Philip Lacroix; 04-20-2014 at 09:29 AM.
Reason: oops, jlinkels had already replied
There are a few ways to block websites in linux. The hosts file is one way. Two links have been given for that method. Another way is to set up IP tables, as has been mentioned. I tried both of those methods and could never get them to work for me the way I needed--probably because I didn't need specific sites blocked, but whole categories of sites. The method I used was to use a proxy+blocker, like squid+dansguardian, or squid+squidguard. This worked for me because it was easier (for me) to set up than trying to figure out IP tables or blocking each site in the hosts file. Also, I could block whole categories (advertisements, malware, etc.) with just a few lines typed into the dansguardian configuration file. Also, those categories were updated through automatic downloads of blacklists every night.
Anyway, method 1:
Edit the /etc/hosts file (google search: How to block sites using /etc/hosts)
Set up IP tables (google search: How to set up IP tables to block sites)
Set up a proxy and blocker (google search: How to set up proxy on linux; how to set up dansguardian on linux; how to set up squidguard on linux)