电脑内没有hosts文件怎么办

作者:彼岸花开 | 创建时间: 2023-03-30
电脑内没有hosts文件怎么办怎么办?其实很简单,我们只需要手动修复下即可,下面由我带给大家电脑内没有hosts文件怎么办的解决方法。...
电脑内没有hosts文件怎么办

操作方法

方法1:我们进入C:\Windows\System32\drivers\etc文件夹,然后新建一个记事本。

然后我们在记事本内输入以下内容: # 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 #127.0.0.1 gilisoft.com 然后保存。

我们保存后,将记事本 新建 文本文档.txt名字改为hosts,记住不要带后辍格式就叫hosts,然后系统会提示你是否确认更改格式,我们点击是就可以了。

方法2:我们按下WIN+R呼出运行菜单,然后在运行菜单中输入:attrib %SystemRoot%\system32\drivers\etc\hosts -h -r -s

然后我们继续在运行菜单中输入:notepad %SystemRoot%\system32\drivers\etc\hosts 这样就可以打开hosts文件了。

点击展开全文

更多推荐