The Hosts file in Windows 11/10, is used to map host names to IP addresses. If for some reason, you find that your Hosts file has been compromised and that some malicious entries have been added, you can if you wish, reset Hosts file back to default.
Reset Hosts file in Windows 11/10
The Hosts file in Windows 11/10 is located at the following location:
C:\Windows\System32\drivers\etc
To reset the Hosts file, open File Explorer, type the following in the address bar and hit Enter:
%systemroot% \system32\drivers\etc
Rename the Hosts file to hosts.bak. You may be required to take ownership of the file first.
Next, create a new default Hosts file. To do so, open a new Text file named hosts in the folder %WinDir%\system32\drivers\etc folder.
Copy-paste the following text into the notepad file:
# 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 handle within DNS itself. # 127.0.0.1 localhost # ::1 localhost
Save the text file.
Download default Windows Hosts file
Alternatively, if you wish you can download the default Hosts file of Windows 11/10 by clicking here. Extract the contents and place the Hosts file in your C:\Windows\System32\drivers\etc folder. You may be asked for permission to replace it.
HostsMan is a good freeware utility that lets you add, remove the entries and generally lets you manage the Hosts File in Windows easily. Go here to see how you can Lock, Manage, Edit Hosts File in Windows.
Does Windows still use the Hosts file?
Yes, Windows still uses the Hosts file. Although DNS has largely automated hostname resolution, the Hosts file remains in the latest operating systems. It allows users to manually map domain names to specific IP addresses, providing a useful tool for custom network configurations or blocking unwanted domains.
What is the purpose of a Host file on a PC?
A Hosts file on a PC maps easy-to-remember hostnames to numerical IP addresses, enabling the operating system to identify and locate hosts in an IP network efficiently. This helps with network management and can override DNS settings.
I checked, but on my windows 7 RC build 7100 hosts does not live in %systemroot% \SysWOW64\drivers\etc.
It does exist in %systemroot% \system32\drivers\etc however.
Am I correct to assume that I should no longer set up my localhost aliases in the hosts file but rather directly in the dns client of the Microsoft Management Console (gpedit). If so, how?
i think it’s not good solution because host file is configure as default setting. Rename host file may be crash system. My good solution is
1. Open Notepad with Administrative privileges by clicking Start, All Programs, Accessories, and then right-click Notepad and select to open as Administrator.
2. Now that Notepad is open with Administrative privileges browse to (C:\Windows\System32\drivers\etc) in Notepad and open the hosts file.
You can set up localhost aliases in the hosts file.
In x86, Hosts file is situated in %systemroot% system32driversetc folder.
This is the recommended way to set the Hosts file to default.
Incidentally, there is now also a ready FixIt solution from Microsoft here: http://support.microsoft.com/kb/972034 .
Thank you so very much.
Aparently this is supposed to fix the problem that i can´t install ublock or adblock plus because an adware messed up everything in my computer. I performed the instructions above and the same error appears. Any suggestions?
Same problem there…
I agree
i just found a sh*tton of trojans and PUPs with a trusted malware detector. nasty little buggers!
this is an old solution, so i’m not sure if it works still, but if you found this, it means that you were probably in the (adblockplus . org) help forums. keep trying the other suggestions… best of luck to everyone!
does the copyright year matter I’m using windows 10 build 10240
No.
what type of file should i save it under?! just leave it as Text Document???
Thanks You :D :D
I’m having a DNS server issue and have tried everything.
Someone suggested this on one of the DNS server fixing videos and I came here.
I want to ask, is it a good or a bad idea to delete the files in the etc. folder? Many people have been saying that and I was curious.
You are a god send. Thank you so much.
It worked