現在,您的疑惑瞭解到哪裡了?
如果還是有疑惑,建議翻閱 RFC 1700、RFC 3330 等相關文件。懶得看英文,就改看這個很簡略的說明
大家好,Windows 7 的 hosts file 預設值如下:
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# 127.0.0.1 localhost
# ::1 localhost
照理說,# 號後方的文字,應該是當做註解。
因此最後兩行
# 127.0.0.1 localhost
# ::1 localhost
應該是沒效的,但為在命令提示字元中 ping localhost 但仍可以得到下面的結果:
C:>ping localhost
Ping computername [::1] (使用 32 位元組的資料):
回覆自 ::1: time<1ms
回覆自 ::1: time<1ms
回覆自 ::1: time<1ms
回覆自 ::1: time<1ms
可以麻煩專家們,說明一下原理嗎?
鎖定的問題。 此問題已從 Microsoft 支援服務社群移轉。 您可以對其是否有幫助進行投票,但無法對問題新增註解或回覆,或進行追蹤。
註解已經有說明了:
localhost name resolution is handle within DNS itself您可以開啟「命令提示字元」,輸入下列指令,並按下 Enter 鍵:
nslookup localhost
看看輸出的結果為何