The role of the hosts file in the Win 2000 operation

Source: Internet
Author: User
Tags domain domain name domain name server access
Many users know that there is a Hosts file (no suffix name) in the Windows 98 system, which is located in the Windows directory, in the Windows 2000/XP system, in the C:\WINNT\SYSTEM32\DRIVERS\ETC Table of Contents. This file is actually a plain text file, with ordinary text editing software such as Notepad can be opened.
With Notepad to open the Hosts file, first saw Microsoft's description of the document. This file works according to the TCP/IP for Windows standard, which is a mapping relationship between IP address and host name (hostname), a provision that maps IP addresses and host name (hostname), and requires that each paragraph only contain a mapping relationship. The IP address is placed at the top of each paragraph, and the mapped host name (hostname) is written after the space. The mapping instructions for this section are separated by "#" with a text description.
Now let's look at how the hosts work in Windows.
We know that access to Web sites on the network, first through the DNS server to the network domain name (www.XXXX.com) resolved into 61.xxx.xxx.xxx IP address, our computer can access. For each domain name request we have to wait for the domain name server to resolve the return of IP information, so that access to the network efficiency will be reduced, and the hosts file can improve the efficiency of resolution. According to the Windows system, before a DNS request is made, the Windows system checks to see if there is an address mapping relationship in its Hosts file, and if so, calls this IP address mapping, if no more domain name resolution is presented to a known DNS server. This means that the request level of hosts is higher than DNS.
Know the Hosts file working method, that in the specific use of what role it?
1, speed up the domain name resolution
For Web sites to visit frequently, we can configure the domain name and IP mapping relationships in hosts so that when we enter a domain name computer, we can quickly resolve IP without requesting a DNS server on the network.
2, Convenient LAN users
In many units of the local area network, there will be a server for users to use. However, because the LAN rarely set up a DNS server, access to these services to enter the difficult to remember the IP address, for many people is quite troublesome. Now you can give these servers an easy to remember name, and then set up an IP map in the hosts, so we will enter the name of the server later on the line.
3, shielding the site
Now a lot of web sites without user consent to install a variety of plug-ins to your computer, some may be trojans or viruses. For these sites we can use hosts to map the site's domain name to the wrong IP or its own computer's IP, so no access. We write the following in the hosts:
127.0.0.1 #屏蔽的网站
0.0.0.0 #屏蔽的网站
So the computer resolution of the domain name to the native or wrong IP, to achieve the purpose of shielding.
4. Smooth Connection System
For Lotus servers and some database servers, access is inaccessible if you enter the IP address directly, and you can only enter the server name to access it. Then we configure the hosts file, so that the input server name can be successfully connected.
Finally, it is pointed out that the Hosts file configuration mapping is static, if the computer on the network changes, please update the IP address in time, otherwise it will not be accessible.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.