Resetting Windows hosts file can help fix connectivity issues
Contents
- Resetting Windows hosts file can help fix connectivity issues
- Reset Windows Hosts File Back to the Defaults
- Steps to reset Windows 7 hosts file
- Quickly reset hosts file on Windows Vista or Windows Server 2008
- Instructions to reset hosts file on Windows XP and Windows Server 2003
- Reset hosts file back to default on Windows 8 and Windows 8.1
- Method to reset Windows 10 hosts file
- An alternative way to restore hosts file on Windows
Hosts file is one of the components of an operating system whose main purpose is to guide hostnames to numerical Internet Protocol (IP) addresses. In other words, it helps to address system nodes in the computer network to identify and locate a host in the IP network. Experts note that it is a regular part of operating system’s IP implementation.
The inside of the hosts file includes lines of specific text — the first line is an IP address followed by a single or multiple hosts names. Every single field is separated by a blank space or a tab (usually preferred for historical reasons). If there is a necessity to include a comment line, they are marked by a hash symbol (#) at the beginning and blank lines in the file are ignored.
Here is a very simplistic Windows hosts file example (hosts file format might differ on other OS):
127.0.0.1 localhost loopback
: :1 localhost
Keep in mind that resetting hosts file can be extremely useful if you encounter problems that are related to accessing websites, etc. For example, if you have tried all other alternative methods but you are still unable to open a certain page, you can reset hosts file back to default and there is a strong chance that it will fix the problem. Additionally, it can help you fix VAWE and USAM ransomware damage that prevents accessing security pages.
The location where you can find hosts file varies depending on the operating system running on your computer. The hosts file is located in %SystemRoot%\System32\drivers\etc\hosts directory on Windows Vista/XP/7/8/10 systems while Mac OS stores the file in /etc/hosts or /private/etc/hosts directory.
While editing and resetting the hosts file on Windows operating system requires administrative privileges, we suggest following the easy step-by-step guide below. It will help you quickly resetting the hosts file without causing damage to your operating system. Alternatively, if you want to reset HOSTS file automatically, you might want to try and download RESTORO.
Reset Windows Hosts File Back to the Defaults
We understand that sometimes completing such tasks might seem very difficult and people search for alternative and easier ways. However, there is no reliable host file reset tool. The only safe way to modify hosts file is to do it manually. For that, we have prepared a detailed guide with special instructions for all operating systems, including Windows Vista/XP/7/8/10 and Mac OS. You can find them below.
Steps to reset Windows 7 hosts file
- Navigate to the bottom-left corner of the screen and press Start;
- Type Notepad and right-click on it;
- Select Run as Administrator and on UAC press Yes;
- Open the Notepad and select File > Open;
- Enter C:\Windows\System32\drivers\etc;
- On the right corner select All Files option and find hosts file;
- Open it, copy the following text inside and select File > Save:
# 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
Quickly reset hosts file on Windows Vista or Windows Server 2008
- Go to Start > Type Notepad and right-click on it;
- Select Run as Administrator and when prompted to UAC, click Yes;
- Open the application and navigate to File > Open;
- Type C:\Windows\System32\drivers\etc and select All Files option;
- Search for hosts file and open it;
- Enter the following text inside and go to File > Save:
# 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
127.0.0.1 localhost
::1 localhost
Instructions to reset hosts file on Windows XP and Windows Server 2003
- Open Notepad; For that, go to Start and type Notepad into the search;
- Click the right button of the mouse on the Notepad and select Run as Administrator;
- Go to File > Open;
- Enter C:\Windows\System32\drivers\etc;
- Press All Files on the top-right corner and search for hosts file to open it;
- Copy and Paste the following text inside the hosts file and save it (File > Save):
# Copyright (c) 1993-1999 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
127.0.0.1 localhost
Reset hosts file back to default on Windows 8 and Windows 8.1
- Click on the Start button and type Notepad into the search;
- Right-click on it and pick Run as Administrator option;
- Press File > Open;
- Type C:\Windows\System32\drivers\etc;
- Select All Files on the right corner and open hosts file;
- Paste the following text inside the document and navigate to File > Save:
# 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
Method to reset Windows 10 hosts file
- Press Start at the bottom-left corner of the screen and search for Notepad;
- Right-click on the application and pick Run as Administrator option;
- Press Yes on the UAC screen;
- Navigate to File > Open;
- Enter C:\Windows\System32\drivers\etc;
- Search for All Files option on the top-right corner and select it;
- Now you see all files and should indicate hosts file to open it;
- Paste the following text and save it by pressing File > Save:
# 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
An alternative way to restore hosts file on Windows
Some people encounter problems that Windows 10 hosts file not working even though they have tried completing instructions indicated above. We have also received complaints about no hosts file Windows 10. In this case, if you can’t edit hosts file Windows 10, we suggest trying this alternative method right below.
- Navigate to Start and open Run;
- Type Notepad and open the application;
- Copy and Paste the text given below into the document:
# 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 - Press Save As and name the file as hosts;
- Open Run and enter C:\Windows\System32\drivers\etc;
- Find hosts file and rename it as hosts.old;
- Copy the new hosts file into the folder and enter the administrator’s password if necessary.
Scott Bolton is a senior content strategist in our Geek’s Advice team. He is exceptionally passionate about covering the latest information technology themes and inspire other team members to follow new innovations. Despite the fact that Scott is an old-timer among the Geeks, he still enjoys writing comprehensive articles about exciting cybersecurity news or quick tutorials.
Leave a Reply