How to modify the Win7 system hosts file?

  

Due to work relationship, or installing some software, you need to modify the hosts file. The role of the hosts file is to associate some commonly used URL domain names with their corresponding IP addresses. However, many users do not know how to modify the hosts file. This article gives you a detailed introduction to the Win7 system to modify the hosts file. Before introducing the changes, let me know how to find the hosts file.

Find the hosts file

1. First, open the desktop "My Computer", or enter the computer through the Start menu;

2 , enter the directory "C:\\Windows\\System32\\drivers\\etc", this time you will see a "hosts" file in the directory, this is the so-called hosts file;

3, in The path of the hosts file under the xp and 03 systems is a bit different. The two systems need to go to the directory "C:\\Windows\\System32\\drivers\\etc" to find the corresponding hosts file. (The default location is %SystemRoot%\\system32\\drivers\\etc\\)

Modify the hosts file

1. After entering the directory, double-click to open the file. As shown below, pop-up "Open the way" window, select "Open with Notepad".

2. After opening the hosts file as text, the contents of the original hosts file are as follows:

# 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.

#

#205, comments (such as these) may be inserted on individual

#行 or following the machine name #d's 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 Handling within DNS itself.

# 127.0.0.1 localhost

# ::1 localhost

3, at the same time, you can also modify the hosts file (domain name) + way of ip address).

4, after saving, under normal circumstances can not be directly saved: select the saved location, and then save it without a suffix name.

5, after the save is complete, copy the corresponding saved files, copy to the "C:\\Windows\\System32\\drivers\\etc" directory (default location is %SystemRoot%\\system32\\drivers\\etc \\).

6. When you click Replace, sometimes you will be prompted for permission. Click “Continue” to replace.

7, so we have completed the modification of the hosts file.

Directory of the hosts file in different systems:

Windows Vista/7/8/8.1: %windir%\\system32\\drivers\\etc\\

Windows XP /Millennium:%windir%\\

Windows 95/98/Me:%WinDir%\\

Linux and other Unix-like operating systems: /etc

8. Modifying After completing the hosts file, after the modification is completed (domain name + ip address), open the running interface (Win+R open) and enter “cmd” to test. (The domain name is a valid domain name, the test is valid, otherwise the test will not work.)

9. After that, enter "ld ping + domain name" in the console, if the domain name is valid, Will first find the information in the hosts file, ping. Then the information of the information ping appears, and the ip address displayed at the same time is the address you configured in the hosts file.

At this point we have completed the search for the hosts file and modify the hosts file, and at the end of the tutorial also tested to see if the modified hosts have taken effect. Finally, the method of how to modify the hosts file in Win7 system is introduced here.

Copyright © Windows knowledge All Rights Reserved