Hosts 文件是所有現代作業系統中都存在的純文字文件,允許網域名稱與 IP 位址本地關聯。 其意義在於,在作業系統查詢網際網路或您的網路上的任何 DNS 伺服器之前,它會先檢查此檔案以取得有關如何解析(尋找特定網域的 IP 位址)的具體說明。 在互聯網早期,該文件是將網域連結到 IP 位址的唯一方法,但隨著網路的發展,DNS 系統得以實施,以動態管理數百萬筆記錄。 然而,hosts 檔案並沒有消失,如今它對於解決衝突、執行本地重定向、預先託管遷移測試、阻止網頁甚至用於開發目的都至關重要。 文件結構非常簡
When you type in a regular web address to access a website, like google.com, your PC doesn't automatically know how to connect. It needs the correct IP address associated with the web address in order to make a connection. The hosts file is the first