Hosts文件的使用

hosts文件是什麼?在哪裏?
hosts文件:系統文件,能夠記事本打開並編輯。
通常用於域名到ip地址的解析。當用戶在瀏覽器中輸入網絡的域名時,系統首先會自動從hosts文件中找到對應的ip地址,一旦找到,將用該ip地址打開對應的網頁。若是沒有找到,則系統會在將網址提交到DMS域名解析服務器進行ip地址的解析。
Windows系統hosts位於 C:\Windows\System32\drivers\etc\hosts(須要管理員權限)
Android(安卓)系統hosts位於 /system/etc/hosts(須要root)windows

 

windows的默認hosts文件瀏覽器

# 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

 

 

修改hosts後生效的方法服務器

cmd中執行網絡

ipconfig /flushdns

固然重啓系統等措施也行。app

相關文章
相關標籤/搜索