无法解析localhost

时间:2011-10-25 14:14:34

标签: macos unix hosts

当我在localhost上执行ping操作时,我得到“ping:无法解析localhost:未知主机”。 ping 127.0.0.1确实有效。所以我检查了我的主机文件,所有内容看起来都是正确的:

##
# 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

#Added by XAMPP Control
127.0.0.1 mkn.local

#Added by XAMPP Control
127.0.0.1 mkn.local

我也做过“dscacheutil -flushcache”,但我仍然无法ping“localhost”。问题是,现在我无法在eclipse中调试,因为eclipse与localhost联系(现在localhost无法解析为127.0.0.1)。

非常感谢您提前提供任何帮助!

P.S。我有OSX 10.7.2(Lion OS)

1 个答案:

答案 0 :(得分:0)

我从较旧的备份恢复了hosts文件。我没有看到我的备份主机文件和当前文件之间有任何差异。但是,它现在有效......魔法

相关问题