当我尝试访问http://mysubdomain.localhost
chrome解析为[::1]80
时,即使主机文件中存在该域的明确条目。其他浏览器没有这种行为。 Firefox,safari和curl都可以解析我的主机文件中给出的IP地址。这是我的主机的全部文件的那一刻:Chrome忽略localhost子域名的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
192.168.88.88 mysubdomain.localhost
然而,当我试图访问镀铬http://mysubdomain.localhost
,它不能解决以192.168.88.88
。这对我来说是个问题,因为192.168.88.88
是在我的电脑上运行的虚拟机。我可以将域名更改为http://mysubdomain.local
或http://mysubdomain.dev
,但这需要我更新项目中许多人使用的配置文件,我宁愿避免这样做,因为我可能会破坏他们工作流程的某些方面。
火狐
卷曲(如所期望的工作)(工作根据需要)
浏览器(如所期望不工作)
我已经尝试了一些事情:从chrome://net-internals/#dns
- 我不使用代理
- 我已清除浏览器缓存多次
- 我已经清除DNS缓存我已经重新启动机器数次
- 我已经清除与终端命令系统DNS缓存
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder
- 我试图隐身模式几次
- 我试图创建一个新的Chrome用户帐户
系统信息:
Chrome版本:53.0.2785.116
OS版本:MAC OS 10.11.6(酋长)
不要忘记,Mac OS X上的Bonjour使用.local TLD。我建议不要使用该顶级域名。 Google显然已经向Google申请了.dev。 我一直在说YEARS现在我们需要为本地开发提供一个专门的TLD。这真是可悲。 –