之前『一文带你简单了解Hosts』科普了Hosts相关内容,这次就教大家如何修改Hosts。
考虑到大多数用户最常用的都是Windows系统,所以就先来介绍Windows下修改Hosts的方法,别担心,其他系统后面有机会也会介绍。
要修改Hosts,那首先得找到Hosts文件。大多数情况下,Hosts文件的路径为:C:\Windows\System32\drivers\etc\hosts。
Hosts文件可以用任何文本编辑工具打开,如记事本等。
Windows平台下原始的Hosts文件内容如下:
#Copyright(c)-MicrosoftCorp.##ThisisasampleHOSTSfileusedbyMicrosoftTCP/IPforWindows.##ThisfilecontainsthemappingsofIPaddressestohostnames.Each#entryshouldbekeptonanindividualline.TheIPaddressshould#beplacedinthefirstcolumnfollowedbythecorrespondinghostname.#TheIPaddressandthehostnameshouldbeseparatedbyatleastone#space.##Additionally,