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

Win10 如何封鎖特定網站?修改 hosts 檔案導向 127.0.0.1 禁止存取

編輯:Windows 10 系統介紹

無需安裝軟體,編輯系統 hosts 檔案即可封鎖指定網域。路徑:C:\Windows\System32\drivers\etc\hosts,以記事本(管理員)開啟,末行新增 127.0.0.1 www.example.com 或 0.0.0.0 www.example.com,存檔即時生效。

操作步驟

  1. 檔案總管輸入路徑 C:\Windows\System32\drivers\etc 找到 hosts。
  2. 右鍵 → 「開啟方式」 → 選「記事本」(建議以管理員身分執行記事本再開啟)。
  3. 檔案末尾新增一行:127.0.0.1 [要封鎖的網域](IP 與網域以空格分隔)。
  4. 存檔 (Ctrl+S),若提示權限不足請參考「hosts 無法存檔處理」。

hosts 檔案位置
以記事本開啟
編輯 hosts
新增封鎖規則
存檔生效

技巧:暫時解封鎖只需在該行行首加 # 註解;支援萬用字元需搭配 DNS 防火牆或瀏覽器擴充功能。

Copyright © Windows教程網 All Rights Reserved