数据恢复使用教程 >

怎么恢复本机hosts文件在哪里

怎么恢复本机hosts文件在哪里

更新日期:2023年04月27日

云骑士数据恢复

在计算机中,hosts文件是一个非常重要的文件,它可以帮助我们更好地管理网络,比如阻止恶意网站的访问,或者让我们更快地访问某些网站。但是,有时候我们可能会不小心把hosts文件搞乱,这时候就需要恢复本机hosts文件了。

那么,怎么恢复本机hosts文件呢?首先,我们需要找到hosts文件所在的位置。在Windows系统中,hosts文件一般位于C:\Windows\System32\drivers\etc目录下,而在Mac OS X系统中,hosts文件一般位于/private/etc/hosts目录下。

接下来,我们就可以开始恢复hosts文件了。在Windows系统中,我们可以打开hosts文件,将里面的内容清空,然后将以下内容复制粘贴进去:

# 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文件就恢复了,你可以继续使用它来管理网络了。

总之,恢复本机hosts文件的方法很简单,只需要找到hosts文件所在的位置,将里面的内容清空,然后将以上内容复制粘贴进去,最后重启计算机即可。

上一篇 :mysql数据全部丢失吗

Copyright © 2020-2022 数据恢复软件下载 版权所有 网站地图 | TXT地图 | 虎观百科 | TAG

联系
客服
扫一扫
添加客服微信
点击图片放大