Host File Settings detailed

Source: Internet
Author: User
Tags domain name server

Host File Settings detailed

A lot of friends don't know what the host file is? In fact, the hosts file is used to record the host IP address and host name of the corresponding relationship, after the establishment can use the host name to access the host, and do not have to remember the IP address. (Hosts is a local simple DNS, it takes precedence over DNS server queries; Oh, I think so.) )

WinXP, Win2K systems are stored under SYSTEM32DRIVERSETC in the Windows system directory, Win98 under the Windows system directory. (The Windows system directory is generally c:windows).

The Hosts file is a plain text file, the format is simple, one line corresponds to an IP address, each line in the format:

IP Address host Name

The IP address and host name are separated by a space, with no limit on the number of spaces.

The content after "#" in any line is considered a comment.

IP address can be any IP, this machine, not the local machine all line.

The IP address and host name of the corresponding relationship can be resolved on the computer and used in the software.

When using the hostname, Windows will first find the corresponding relationship in the Hosts file, and if not, send a resolution request to the domain name server. Hosts the IP pointer that can be used to transfer some host names on the computer.

After the general installation of Windows system, the hosts file in addition to comments, there is only one line of valid correspondence:

127.0.0.1 localhost

This is the IP address that represents this computer.

Users can add the required IP and host names themselves.

For example, do not want to visit http://www.123.com, then we write the following in the hosts:

127.0.0.1 http://www.123.com# Shielded Web site

0.0.0.0 http://www.123.com# Shielded Web site

So the computer resolution of the domain name to the native or wrong IP, to achieve the purpose of shielding.

* * Finally remember to set the host file as read-only property, so generally speaking, malicious Web site can not modify the host file. **

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.