我正在使用OS X 10.8.5和Chrome 30。
我添加127.0.0.1       youtube.com到/etc/hosts文件中,现在它包含以下内容:
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
127.0.0.1       youtube.com
运行命令时,traceroute youtube.com我收到预期的结果(youtube.com已解析为127.0.0.1):
traceroute to youtube.com (127.0.0.1), 64 hops max, 52 byte packets
1  localhost (127.0.0.1)  0.272 ms  0.118 ms  0.063 ms
但是,当我在Chrome中输入youtube.com时,我的浏览器未与127.0.0.1建立连接,而是与YouTube的“常规” IP地址建立了连接。我希望Chrome将youtube.com解析为127.0.0.1。
我已将Chrome配置为使用系统的代理设置。在OS X中,当我进入“系统偏好设置”>“网络”>“高级...”>“代理”时,我选择了“自动代理发现”。
为什么Chrome似乎忽略了我的/etc/hosts文件?

