Modify the domain name resolution file hosts file

  
        

How to modify the hosts file?

Location of the hosts file: xp, 2000, etc. Find the Hosts file in the C:windowssystem32driversetc folder and open it with Notepad (Windows 9x/Me system is found in the C:Windows folder) according to the ip address; The format adds a separate row of records. For example, 72.14.219.190 www.mypchelp.cn Note that there should be no spaces in front of the IP address, and there must be at least 1 space between the ip address and the domain name. After making changes, be sure to remember to save the file. How do I know that the IP address of a domain name has taken effect? On your computer, please follow the steps below: Start-->Run-->Enter cmd-->ping Domain-->Enter to see the result is similar to Reply from 220.181.31.183: bytes=32 time =79ms TTL=53 in the middle; 220.181.31.183 is the IP address of the domain name to close all browsers, re-open, test whether the domain name you just added can be accessed normally. If the access is not normal, please follow the 3 steps to check the settings you just set. Does the domain name correspond to the correct IP address? What is the file name resolution file Hosts? What is the role of

1. Speed ​​up domain name resolution

For websites that need to be visited frequently, we can configure the mapping between domain name and IP in Hosts, so that when we enter the domain name computer, we can Parse the IP quickly without requesting a DNS server on the network.

2. Convenient LAN users

In many units of the LAN, there will be servers available to users. However, since the DNS server is rarely installed in the local area network, it is quite troublesome for many people to access these services by inputting a hard-to-remember IP address. Now you can give these servers a name that is easy to remember, and then create an IP mapping in Hosts so that we can enter the name of the server when we access it later.

3. Blocking Websites

There are many websites that install a variety of plugins into your computer without the user's consent. Some may be Trojans or viruses. For these sites, we can use Hosts to map the domain name of the site to the wrong IP or the IP of the computer, so that there is no need to access it. For example, if you don't want to visit www.XXXX.com, then we write the following on Hosts:

127.0.0.1 www.XXXX.com #屏蔽的网站0.0.0.0 www.XXXX.com #屏蔽的网站

This way the computer resolves the domain name and resolves it to the local or the wrong IP, achieving the purpose of blocking.

4. Smooth connection system

For Lotus servers and some database servers, if you directly enter the IP address during access, it is not accessible, you can only enter the server name to access. Then we configure the Hosts file so that the server name can be successfully connected.

The last thing to point out is that the mapping of the Hosts file configuration is static. If the computer on the network changes, please update the IP address in time, otherwise it will not be accessible.

5. Force a domain name to be assigned to an IP address;

Copyright © Windows knowledge All Rights Reserved