问题
When I do a ping on localhost, I get "ping: cannot resolve localhost: Unknown host". A ping on 127.0.0.1 does work. So I checked my hosts file and everything looks so far correctly:
##
# 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
I also did a "dscacheutil -flushcache" but I still can't ping "localhost". The problem is that right now I can't debug anymore in eclipse because eclipse contacts localhost (and right now localhost cannot be resolved to 127.0.0.1).
Many thanks for any help in advance!
P.S. I have OSX 10.7.2 (Lion OS)
回答1:
I restored the hosts file from an older backup. I don't see any differences between my backuped hosts file and the current file. However, it works now .... magic
来源:https://stackoverflow.com/questions/7890663/cannot-resolve-localhost