亚洲ⅴ国产v天堂a无码二区,2017久久男人天堂,欧美日韩亚州一区,亚洲av无码av在线播放

U質(zhì)服務(wù) 快速啟動

hosts文件位置含Win7/8/10 Mac Linux修改方法附hosts文件

發(fā)布時間:??2017-04-06 10:04 來源:http://www.thwz.com.cn

Hosts是一個沒有擴展名的系統(tǒng)文件,其作用就是將一些常用的網(wǎng)址域名與其對應(yīng)的IP地址建立一個關(guān)聯(lián)“數(shù)據(jù)庫”,可以用記事本打開。當(dāng)用戶在瀏覽器中輸入一個需要登錄的網(wǎng)址時,系統(tǒng)會首先自動從Hosts文件中尋找對應(yīng)的IP地址,一旦找到,系統(tǒng)會立即打開對應(yīng)網(wǎng)頁,如果沒有找到,則系統(tǒng)會再將網(wǎng)址提交DNS域名解析服務(wù)器進行IP地址的解析。
 
這就是為什么通過修改hosts文件就可以瀏覽谷歌等被墻網(wǎng)站,原因是直接訪問目標(biāo)網(wǎng)站對應(yīng)ip,不通過DNS。下面匯總介紹下各系統(tǒng)hosts文件位置含Win7/8/10 Mac Linux以及修改方法。
 
hosts文件位置
 
Windows系統(tǒng)hosts位于 C:WindowsSystem32driversetchosts

Android(安卓)系統(tǒng)hosts位于 /system/etc/hosts

Mac(蘋果電腦)系統(tǒng)hosts跟Linux一樣位于 /etc/hosts

iPhone(iOS)系統(tǒng)hosts跟Linux Mac一樣位于 /etc/hosts

Linux系統(tǒng)hosts位于 /etc/hosts
 
你可以用記事本打開并修改
 
PC建議用Notepad++進行編輯。
 
注意:hosts文件屬于系統(tǒng)核心文件之一,所以Windows用戶必須用管理員身份打開才能修改保存,如果遇到無法保存,請右鍵文件hosts并找到“屬性” -> “安全”,然后選擇你登陸的用戶名,最后點擊編輯,勾選“寫入”即可。
 
Android(安卓)必須Root才能修改,Root Explorer管理器或ES文件瀏覽器裝載/system可寫狀態(tài),找到/system/etc/hosts的文件,使用文本編輯器打開編輯后保存。
 
Linux系統(tǒng)使用Root權(quán)限vi編輯
 
而iPhone、iPad也必須越獄才能修改!Windows系統(tǒng)跟蘋果系統(tǒng)的hosts文件文本編碼和換行符格式一樣,而Android(安卓)則不一樣,這點你需要注意。
 
Windows系統(tǒng)原版hosts文件:
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
# 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

Mac、iPhone、iPad原版hosts文件:
 
1
2
3
4
5
6
7
8
9
10
 
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::10 localhost

Linux系列我就不列出了,一般用這個系統(tǒng)的人都不會是小白。
 
大家或許留意到,原版的hosts文件前面都帶有井號“#”,以#開頭的都是注釋用的,所以并沒什么卵用,如果你想快速恢復(fù)原版hosts文件,那么也可以直接清空里邊的內(nèi)容,一般情況沒有什么影響。
 
修改hosts文件后生效的方法:
 
Windows
開始 -> 運行 -> 輸入cmd -> 在CMD窗口輸入:
 
1
 
ipconfig /flushdns

Linux
終端輸入
 
1
 
sudo rcnscd restart

對于systemd發(fā)行版,請使用命令
 
1
 
sudo systemctl restart NetworkManager

如果不懂請都嘗試下
 
Mac OS X終端輸入
 
1
 
sudo killall -HUP mDNSResponder

Android

開啟飛行模式 -> 關(guān)閉飛行模式
 
通用辦法:
 
拔網(wǎng)線(斷網(wǎng)) -> 插網(wǎng)線(重新連接網(wǎng)絡(luò)) 或者重啟系統(tǒng)。
 
清空瀏覽器緩存(不要使用國產(chǎn)瀏覽器)
 
以上就是關(guān)于Win7/8/10 Mac Linux等各系統(tǒng)的hosts文件位置相關(guān)介紹,比較全面,以供大家參考。
分享到:
Copyright ? 2010-2016 www.thwz.com.cn u啟動 版權(quán)所有 閩ICP備16007296號 意見建議:service@uqidong.com