The meaning and role of the host file

Source: Internet
Author: User
Tags domain name server

What is a host file:

Hosts is a system file without extensions, its basic role is to some commonly used URL domain name and its corresponding IP address to establish an association "database",

When the user enters a URL in the browser that needs to be logged in,

The system will first automatically look for the corresponding IP address from the Hosts file,

Once found, the system will immediately open the corresponding page, if not found,

Then the system will submit the URL to DNS domain name resolution server for IP address resolution,

If you find a blocked IP or domain name, you will be prevented from opening this page!

Location of host File:

In the XP, Win7 system, the host file

is located in the system disk C:WINDOWSSYSTEM32DRIVERSETC,

If you do not see the hos file, it is because some systems hide the host file.

Based on the above introduction, we can summarize the host file four main functions:

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,

Improve the speed of domain resolution. Because of the mapping relationship, when we enter the domain name computer can quickly parse out IP,

Instead of requesting DNS servers on the network.

For example: Add one to the host file: 222.73.44.198 blog.itful.com

(IP and domain name in the middle to have a space, IP address must be entered correctly, otherwise it will not be able to access the site)

--By running CMD, enter the "ping site domain name" to obtain the IP address of the website!

This will be a little faster to visit the Warrior Island, because he does not need to go through the DNS domain name server for IP address resolution!

2, Convenient LAN users

In many units of the local area network, there will be a server for users to use.

However, because the local area network usually rarely set up DNS servers,

When accessing these servers, enter an IP address that is difficult to remember.

This is quite troublesome for many people.

Now you can get a name that's easy to remember for each of these servers,

Then set up IP mappings in hosts so that when you visit later,

Just type in the name of the server.

3, shielding the site

There are many websites that install all kinds of plug-ins into your computer without the user's consent.

There are no lack of virus Trojans.

For these sites we can use the hosts to map the site's domain name to a wrong IP or local computer IP,

So you don't have to visit.

In the Windows system,

Convention 127.0.0.1 is the IP address of the local computer, 0.0.0.0 is the wrong IP address.

For example, in hosts, we enter the following (an example)

127.0.0.1 Www.sex.com # This site affects my child's healthy growth, I want to block him

In this way, when the computer resolves the domain name www.sex.com, it resolves to the native IP or wrong IP, and achieves the purpose of shielding the unhealthy website.

Now some viruses, malware programs will modify our host file,

Causes us to not be able to access certain websites, and when we find that some sites are inaccessible,

We can go into the host file for observation,

If the Web site caused by the host file cannot be accessed,

Delete a virus-added statement to make normal access to your site

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.