Merge pull request #795 from yechunxiao19/master

翻译完成 by 乌龙茶
This commit is contained in:
Xingyu.Wang 2014-03-04 23:23:32 +08:00
commit 690e46cc94
2 changed files with 43 additions and 44 deletions

View File

@ -1,44 +0,0 @@
乌龙茶占坑
How To Block A Website In Ubuntu
================================================================================
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/02/block-websites.jpg)
Dear **ubuntu** geeks,
In this tutorial I will teach you how to block unwanted websites in Ubuntu Linux by editing the **/etc/hosts** file which is used to handle DNS and internet on Linux based systems.
I like very much this method because I dont need to rely on third party applications and it is extremely easy to use. All you need to do is to make a simple change in the **/etc/hosts** file.
Make sure to have superuser access on the machine you are using this method, because the **/etc/hosts** file is owned by the root user and so it cannot not be edited by everyone.
What do you need to edit the **/etc/hosts** file?
root permissions and a text editor.
For this tutorial I will use my favourite text editor, vim. Ok guys, open a new terminal (**CTRL+ALT+T**) and run the following command to open the /etc/hosts file for editing.
vim /etc/hosts
Then add the following line.
127.0.0.1 domain.com
Replace the domain.com with the website you want to block and after you have finished the editing process, save the file and quit.
Now it is time to test if the method has worked or not. Try to access the website you blocked.
My cousin is addicted to the facebook social network so every time he find my laptop, he opens it and goes to facebook.com to chat with his friends.
What should I do?
I edit the **/etc/hosts** file and act like the website he is trying to reach is down.
You can also use this method to protect kids from adult content on the internet such as porn and horror movies.
--------------------------------------------------------------------------------
via: http://www.unixmen.com/block-website-ubuntu/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,43 @@
如何在Ubuntu中屏蔽一个网站
================================================================================
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/02/block-websites.jpg)
亲爱的**ubuntu**极客们,
在本教程中我将教你如何通过编辑**/etc/hosts**文件来屏蔽在Ubuntu Linux上不受欢迎的网站这是用来处理DNS和Linux网络的系统文件。
我很喜欢这种方法,因为我不需要依靠第三方应用程序,这是非常容易使用的。您需要做的就是在**/etc/hosts文件**文件中做一个简单的变化。
请确保您有使用此方法时在机器上处于root用户访问状态因为**/etc/hosts文件**文件由root用户拥有的所以它不能被不被普通用户编辑。
你需要在**/etc/hosts**文件中编辑什么那?
root权限和一个文本编辑器。
在本教程中我将用我喜欢的文本编辑器vim。好了打开一个新的终端**CTRL+ALT+T**),然后运行下面的命令来打开/etc/hosts文件进行编辑。
vim /etc/hosts
添加下面这行
127.0.0.1 domain.com
更换domain.com为你要屏蔽的网站你完成了编辑处理后保存该文件并退出。
现在是时候来测试该方法是否成功了。尝试访问你屏蔽的网站。
我的表弟是沉迷于Facebook的社交网络每次他发现我的笔记本电脑的时候他就打开它并去facebook.com陪陪他的朋友。
我应该怎么做那?
我编辑**/etc/hosts**文件,这样他想访问的网站就像已关闭了一样。
您也可以使用这个方法来保护孩子免受互联网成人内容的危害,如色情和恐怖电影。
--------------------------------------------------------------------------------
via: http://www.unixmen.com/block-website-ubuntu/
译者:[乌龙茶](https://github.com/yechunxiao19) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出