
By mistake, you deleted the Hosts file, or after several changes to the file, you are unable to restore the default version.
Don’t worry, below is a mini guide to recreate the original file.
But what is the Hosts file? Why is its presence important on the computer?
The Hosts file is used by the operating system to map domain names (defined as human-friendly hosts) to numerical IP addresses that identify and locate a host in an IP network.
The Hosts file contains text lines consisting of an IP address in the first field and one or more host names in the second. Each field is separated by a space or tab. Comment lines must be preceded by the hash character (#). Empty lines in the file are ignored.
If the Hosts file is modified, by default, restoring it can help resolve some connectivity issues.
To recreate the default Hosts file, follow the procedure below:
Copy the text and paste it into Notepad.
- Create a new file with Notepad.
- Copy the text and paste it into Notepad.
# Copyright (c) 1993-2006 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
- In the File menu, select Save As, type “hosts” in the File Name box, and then save the file to the desktop or a folder of your choice.
- Important note: The generated file might have a .TXT extension. Enable the display of file name extensions and rename the file by removing the extension.

- Click on Start and search for the Run command (or from Cortana, select the File Explorer icon) and type the following text:
%WinDir%\System32\Drivers\Etc
- Rename the existing Hosts file in the folder (e.g., Hosts.old) and insert the newly created file.
- If prompted to enter administrator permissions, click Continue.
