Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

hosts 檔修改不生效?關閉 DNS Client 服務讓變更即時生效

編輯:Windows 7 系統介紹

修改 hosts 檔封鎖惡意網址卻不生效,主因是「DNS Client」服務快取了舊解析。停用該服務並設為手動,hosts 變更即可即時生效。

解決步驟

  1. 確認 hosts 檔以 ANSI 編碼儲存(Unicode 不會被讀取),路徑 C:\Windows\System32\drivers\etc\hosts。
  2. 控制台 → 系統管理工具 → 服務,找到 DNS Client。
  3. 停止服務,啟動類型改為「手動」。

之後修改 hosts 無需執行 ipconfig /flushdns,存檔即刻生效。注意:此法僅解決「修改後不生效」,非解決「無權限修改」問題。

Copyright © Windows教程網 All Rights Reserved