2011-10-25 189 views
0

當我在本地主機上執行ping時,出現「ping:can not resolve localhost:Unknown host」。在127.0.0.1上的ping確實有效。所以,我檢查了我的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 

#Added by XAMPP Control 
127.0.0.1 mkn.local 

#Added by XAMPP Control 
127.0.0.1 mkn.local 

我也做了一個「dscacheutil -flushcache」,但我仍無法ping通「本地主機」。問題是,現在我不能在eclipse中調試,因爲eclipse聯繫本地主機(現在localhost不能解析爲127.0.0.1)。

非常感謝任何幫助提前!

P.S.我有OSX 10.7.2(Lion操作系統)

+0

呵呵,爲本地主機存在多個條目是正常的嗎?我不這麼認爲...... – bdares

+0

這不是一個編程問題,更適合http://serverfault.com/祝你好運。 – shellter

回答

0

我從舊的備份中恢復了主機文件。我沒有看到我的備份主機文件和當前文件有任何區別。然而,它現在的作品....魔術