How to Reset Hosts File to Default in Windows?

share this: facebook | twitter | google+ | reddit | tell a friend

UPDATE: A freeware is available to do this task automatically. Check this link to download it.

"Hosts" file is an important system file in Windows which maps hostnames to IP addresses. Its a simple text file which is stored in "%windir%\System32\drivers\etc\" folder in Windows 32-bit editions. In 64-bit editions, it might be also stored in "%windir%\SysWOW64\drivers\etc\" folder.

The hosts file's structure is very simple. It contains text lines containing IP address followed by the hostname.

Sometimes this hosts file is hijacked by viruses, adware, spyware or trojan horse software and is modified to redirect your web browser to various websites containing malicious code. It might also block security websites and Windows Update website in your system so that you can't install security updates and virus definitions in your operating system.

If you are also facing a similar problem, you should check the hosts file and make sure it contains the default values. To reset hosts file to default, you can follow these simple steps:

1. Type following in RUN or start menu searchbox and press Enter:

%windir%\System32\drivers\etc\

2. Now you'll see a file with the name hosts in etc folder.

Hosts_File_Windows.png

3. Open the file in Notepad and replace its content with following text:

For Windows 7, Windows 8 and later:

# 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

For Windows Vista and Server 2008:

# 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

For Windows XP and Server 2003:

# 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

4. Save the file and you have reset the file to default.

NOTE: If you don't want to do it manually, you can download an automatic Fixit tool released by Microsoft to reset Hosts file to default:

Download Automatic Fixit to Reset Hosts File to Default

Thanks to our friend "Rob Margel" for sharing it...





Posted by: | Categories: Troubleshooting, Windows 7, Windows 8 / 8.1, Windows Vista, Windows XP


Other similar articles that may interest you


Comments

Leave a Comment

(required)