hosts文件是什么?
生活随笔
收集整理的這篇文章主要介紹了
hosts文件是什么?
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1. 什么是Hosts文件?
Hosts是一個沒有擴展名的系統文件,可以用記事本等工具打開,其作用就是將一些常用的網址域名與其對應的IP地址建立一個關聯“數據庫”,當用戶在瀏覽器中輸入一個需要登錄的網址時,系統會首先自動從Hosts文件中尋找對應的IP地址,一旦找到,系統會立即打開對應網頁,如果沒有找到,則系統再會將網址提交DNS域名解析服務器進行IP地址的解析。
2. 為什么進行Hosts 文件修復?
很多病毒會修改Hosts文件,例如:把Baidu、Google等常用地址均指向病毒網站,只要你上網搜索,自然會中毒!也會利用修改Hosts文件把購物、銀行等網站指向釣魚網站,盜取您的賬號密碼。更有甚者,病毒會通過修改Hosts使您無法訪問殺毒軟件官網,無法下載殺毒軟件進行查殺,所以Hosts文件修復非常重要。
3. hosts文件位置
windows 系統:C:\WINDOWS\system32\drivers\etc
4. 文件默認內容為:
# 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文件被病毒、木馬修改,可復制以上內容修復hosts文件。
本地通過hosts實現屏蔽網站,例如我們想屏蔽或你想本地流量cctv.com為本地網站,可以在后面添加127.0.0.1 cctv.com
總結
以上是生活随笔為你收集整理的hosts文件是什么?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 开启我的博客之旅
- 下一篇: Android平台发展史