Hosts文件是將網址域名與其對應的IP地址建立一個關聯“數據庫”,我們在打開網頁的時候首先會從Hosts文件中尋找對應的IP地址進行打開!最近使用win10係統的用戶反應不小心將hosts文件刪除了,該如何恢複?下麵小編給大家分享下恢複方法。
步驟:
1、打開此電腦,依次打開:C:\Windows\System32\drivers\etc “hosts”文件的目錄中;
2、選擇【新建】—【文本文檔】;
3、雙擊【打開新建文本文檔.txt】,將以下代碼複製進去,然後關閉,在提示框中點擊【保存】;
# Copyright (c) 1993-2009 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 handled within DNS itself.
#127.0.0.1 localhost
#::1 localhost
4、將【新建文本文檔.txt】右鍵,選擇重命名,將後麵的TXT刪除,然後命名為:hosts ,在彈出的框中點擊“是”即可。
www.win7999.com
有用戶可能會遇到“新建文本文檔”後麵沒有顯示【TXT】的情況,則通過【顯示擴展名】的方法即可顯示TXT了。