Ubuntu Tutorial: how to block a website in Ubuntu

Source: Internet
Author: User
Dear Ubuntu geeks, In this tutorial, I will teach you how to edit the/etc/hosts file to shield undesirable websites on UbuntuLinux, this is a system file used to process DNS and Linux networks. I like this method very much, because it is very easy to use because I don't need to rely on third-party applications. What you need to do is to make a simple change in the/etc/hosts file. Make sure that you are in the root user access status on the machine when using this method, because/etc/hos

Dear Ubuntu geeks,

In this tutorial, I will teach you how to edit the/etc/hosts file to block undesirable websites on Ubuntu Linux, which is used to process system files on DNS and Linux networks.

I like this method very much, because it is very easy to use because I don't need to rely on third-party applications. What you need to do is to make a simple change in the/etc/hosts file.

Make sure that you are in the root user access status on the machine when using this method. Because the/etc/hosts file is owned by the root user, it cannot be edited by normal users.

What do you need to edit the/etc/hosts file? Root permission and a text editor.

In this tutorial, I will use my favorite text editor, vim. Okay, open a new terminal (CTRL + ALT + T), and then run the following command to open the/etc/hosts file for editing.

Vim/etc/hosts

Add the following line

127.0.0.1 domain.com

Change domain.com to the website you want to shield. After editing, save the file and exit.

Now it is time to test whether the method is successful. Try to access the website you blocked.

My cousin is addicted to Facebook's social network. Every time he finds my laptop, he opens it and goes to facebook.com to accompany his friends.

What should I do?

I edit the/etc/hosts file so that the website He Wants To access is like the one he wants to access.

You can also use this method to protect your child from adult content on the Internet, such as pornographic and terrorist movies.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.