Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows 綜合教學 >> 關於 Windows

Win7 驗證 localhost 解析狀態:ping 指令快速檢測 hosts 檔案是否被竄改

編輯:關於 Windows

病毒常竄改 C:\Windows\System32\drivers\etc\hosts 將熱門網域導向惡意 IP。Win7 可用 ping localhost 快速驗證解析是否正常:若回應正常代表 hosts 未被惡意修改;若無回應或解析異常,需掃毒並修復系統檔案。

操作步驟

  1. Win+R → cmd 開啟命令提示字元。
  2. 輸入 ping localhost 按 Enter。
  3. 觀察回應:
    正常:回覆自 ::1: 時間<1ms 或 回覆自 127.0.0.1: 位元組=32 時間<1ms
    異常:請求逾時、解析錯誤 IP、回應非 127.0.0.1/::1。
  4. 異常時執行:完整掃毒 → sfc /scannow → 檢查 hosts 檔案內容 (應僅含 127.0.0.1 localhost 與 ::1 localhost)。

ping localhost 正常回應

補充:手動檢視 hosts 檔案

  1. 記事本以系統管理員身分開啟 C:\Windows\System32\drivers\etc\hosts。
  2. 確認無非預設條目 (惡意導向通常在檔案末尾)。
  3. 若遭竄改,備份後還原預設內容並存檔。
Copyright © Windows教程網 All Rights Reserved