国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

Win7/8/10 Mac中hosts文件位置介紹 Mac Linux中hosts文件修改方法

瀏覽:4日期:2023-04-08 18:37:06

Hosts是一個沒有擴展名的系統(tǒng)文件,其作用就是將一些常用的網(wǎng)址域名與其對應的IP地址建立一個關(guān)聯(lián)“數(shù)據(jù)庫”,可以用記事本打開。當用戶在瀏覽器中輸入一個需要登錄的網(wǎng)址時,系統(tǒng)會首先自動從Hosts文件中尋找對應的IP地址,一旦找到,系統(tǒng)會立即打開對應網(wǎng)頁,如果沒有找到,則系統(tǒng)會再將網(wǎng)址提交DNS域名解析服務器進行IP地址的解析。下面小編就給大家?guī)鞼in7/8/10 Mac中hosts文件位置介紹和Mac Linux中hosts文件修改方法,一起來看看吧!

這就是為什么通過修改hosts文件就可以瀏覽谷歌等被墻網(wǎng)站,原因是直接訪問目標網(wǎng)站對應ip,不通過DNS。

Win7/8/10 Mac中hosts文件位置介紹 Mac Linux中hosts文件修改方法

Windows系統(tǒng)hosts位于C:WindowsSystem32driversetchostsAndroid(安卓)系統(tǒng)hosts位于/system/etc/hostsMac(蘋果電腦)系統(tǒng)hosts跟Linux一樣位于/etc/hostsiPhone(iOS)系統(tǒng)hosts跟Linux Mac一樣位于/etc/hostsLinux系統(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文件:

123456789101112131415161718192021 # 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文件:

12345678910 ### Host Database## localhost is used to configure the loopback interface# when the system is booting. Do not change this entry.##127.0.0.1 localhost255.255.255.255 broadcasthost::1localhostfe80::10localhost

Linux系列我就不列出了,一般用這個系統(tǒng)的人都不會是小白。

大家或許留意到,原版的hosts文件前面都帶有井號“#”,以#開頭的都是注釋用的,所以并沒什么卵用,如果你想快速恢復原版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)絡) 或者重啟系統(tǒng)。

清空瀏覽器緩存(不要使用國產(chǎn)瀏覽器)

以上就是關(guān)于Win7/8/10 Mac Linux等各系統(tǒng)的hosts文件位置的介紹了,希望大家喜歡!

主站蜘蛛池模板: 永昌县| 宁乡县| 全椒县| 谷城县| 锦州市| 崇阳县| 南皮县| 凌源市| 丰顺县| 黎川县| 鄂州市| 丘北县| 井研县| 汝城县| 荆门市| 长兴县| 比如县| 甘南县| 福鼎市| 万州区| 孝义市| 北海市| 新竹市| 南宫市| 永安市| 江门市| 枝江市| 江门市| 漳州市| 桐乡市| 青龙| 沙河市| 武穴市| 永年县| 南部县| 河西区| 弋阳县| 郓城县| 罗平县| 土默特左旗| 磴口县|