当您的电脑出现无法访问某些网站、DNS解析异常或网络连接问题时,可能是由于 hosts 文件被恶意修改所致。本页面为您提供安全、简便的 一键还原hosts文件 方法,帮助您快速恢复系统默认配置。
hosts 是操作系统中用于将主机名映射到IP地址的本地文本文件。它优先级高于DNS服务器,常被用于屏蔽广告、加速访问或开发测试。但若被病毒、恶意软件篡改,可能导致网络异常。
C:\Windows\System32\drivers\etc\hosts# Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost
sudo cp /etc/hosts /etc/hosts.bak
echo '## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## .0.0.1 localhost .255.255.255 broadcasthost ::1 localhost ' | sudo tee /etc/hosts
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
hosts 文件。hosts 的修改,请临时关闭实时防护(操作后记得开启)。