How to Block a Website in Linux
Sometimes certain websites can limit your productivity. If you are a Linux user, you can quickly and simply avoid such websites by blocking them at an "IP" level. This means that no matter what browser you use, you will not be able to visit blocked sites. You will need to have Super User privileges to be able to accomplish this task.
Instructions
-
-
1
Open a Terminal by going to "Applications" and "Terminal."
-
2
Type "su" (without the quotes) and hit "Enter" to become a super user (you will need super user permissions to run the command in the next step). Type in your super user password, and press "Enter."
-
-
3
Type the following command, replacing "WebsiteYouWantToBlock" with the actual website name you want to block:
iptables -A INPUT -s WebsiteYouWantToBlock.com -j DROP -
4
Open your favorite web browser and try to access the website you blocked. You will get a "404 File Not Found" error, and you will not have access to the website.
-
1
References
- Photo Credit no image by hugy from Fotolia.com