修改 Hosts 檔案免 VPN 直接連線造訪被 DNS 汙染網站教學
對於電腦用戶而言,可能因為 ISP 電信商,或是身處對岸關係,遇到 DNS 汙染或是伺服器沒有即時更新,導致無法瀏覽網站情況?這種時候可以修改 Windows 系統資料夾 Hosts 檔案來改善這情況,幫助用戶們可以順利造訪各大網站與玩遊戲,來看教學 ~
使用教學:
如下圖電腦打開資料夾 C:\Windows\System32\drivers\etc,找到名為 hosts 檔案使用記事本開啟。
接著於下方添加相對應網域還有 IP 位置(注意:IP 和網址間有個英文空格,連結不含 https://),完成後按存檔即可。
修改好的 hosts 檔案記得要先清除瀏覽器暫存檔案,接著在網址貼上原本被 DNS 汙染無法造訪連結,這時鏈結務必加上 https:// 例如 https://www.google.com/ 。
#備註1:此方法須 IP 仍可識別沒有被屏蔽封鎖,否則仍須透過 VPN 才能順利造訪。
#備註2:手機裝置步驟繁雜安卓需要 root、iPhone 得要越獄權限要求高 之後有空介紹。
Hosts 檔案重設回預設值:
Windows 10 hosts 檔案預設值如下,可搜尋 %WinDir%\System32\Drivers\Etc 找到檔案並進行覆蓋。
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handle within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
至於 Windows 7 與 XP hosts 檔案預設值分別如下,搜尋 %WinDir%\System32\Drivers\Etc 找到檔案並進行覆蓋。
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handle within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
另外補充一下有玩俠盜列車手 GTA V 朋友們可能因為 Rockstar Games 俗稱 R 星連線問題無法玩遊戲,可以把下列資訊填入 hosts 檔案,完成後另存新檔就可以了。
# RockStar Start
192.81.241.11 conductor-prod.ros.rockstargames.com
192.81.241.100 conductor-prod.ros.rockstargames.com
#208.111.148.6 patches.rockstargames.com
#208.111.149.150 prod.cloud.rockstargames.com
#54.68.41.239 prod.cs.ros.rockstargames.com
192.81.245.200 prod.p01sjc.pod.rockstargames.com
192.81.245.201 prod.p02sjc.pod.rockstargames.com
192.81.241.11 prod.ros.rockstargames.com
#54.149.44.210 prod.telemetry.ros.rockstargames.com
# RockStar End