小编Jon*_*han的帖子

为什么 Chrome 会忽略 OS X 上的 /etc/hosts?

我使用的是 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
Run Code Online (Sandbox Code Playgroud)

当我运行命令时,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
Run Code Online (Sandbox Code Playgroud)

但是,当我在 Chrome 中输入 youtube.com 时,我的浏览器没有与 127.0.0.1 建立连接,而是与 …

networking dns google-chrome macos

36
推荐指数
3
解决办法
3万
查看次数

标签 统计

dns ×1

google-chrome ×1

macos ×1

networking ×1