为了使我在工作的时候不去某些网站浪费时间,在苹果电脑上可以使用以下方法屏蔽某些域名,使之转向与自己的电脑。
1: 使用命令:
sudo vim /private/etc/hosts
2: 显示如下:
1 ##
2 # Host Database
3 #
4 # localhost is used to configure the loopback interface
5 # when the system is booting. Do not change this entry.
6 ##
7 127.0.0.1 localhost
8 255.255.255.255 broadcasthost
9 ::1 localhost
10 fe80::1%lo0 localhost
3: 在文件后添加若干行(11-13行),每行对应一个域名,文件如下:
1 ##
2 # Host Database
3 #
4 # localhost is used to configure the loopback interface
5 # when the system is booting. Do not change this entry.
6 ##
7 127.0.0.1 localhost
8 255.255.255.255 broadcasthost
9 ::1 localhost
10 fe80::1%lo0 localhost
11 127.0.0.1 www.weibo.com/
12 127.0.0.1 www.renren.com/
13 127.0.0.1 sports.sina.com.cn/
4: 退出编辑器:wq
如果是linux 机器,修改/etc/hosts 文件应该可以达到想通的效果。
1: 使用命令:
sudo vim /private/etc/hosts
2: 显示如下:
1 ##
2 # Host Database
3 #
4 # localhost is used to configure the loopback interface
5 # when the system is booting. Do not change this entry.
6 ##
7 127.0.0.1 localhost
8 255.255.255.255 broadcasthost
9 ::1 localhost
10 fe80::1%lo0 localhost
3: 在文件后添加若干行(11-13行),每行对应一个域名,文件如下:
1 ##
2 # Host Database
3 #
4 # localhost is used to configure the loopback interface
5 # when the system is booting. Do not change this entry.
6 ##
7 127.0.0.1 localhost
8 255.255.255.255 broadcasthost
9 ::1 localhost
10 fe80::1%lo0 localhost
11 127.0.0.1 www.weibo.com/
12 127.0.0.1 www.renren.com/
13 127.0.0.1 sports.sina.com.cn/
4: 退出编辑器:wq
如果是linux 机器,修改/etc/hosts 文件应该可以达到想通的效果。
Aucun commentaire:
Enregistrer un commentaire