What is the hosts file of the domain name resolution file? How to modify the hosts file?

Source: Internet
Author: User
What is the hosts file of the domain name resolution file? How to modify the hosts file?
  • Published on: popularity: 172947
  • Hongbo CMS website creation system: function list-Free Download
    -Green trial version

  • How to modify the hosts file?

      1. Hosts fileLocation: XP, 2000, and other systems in the c: \ windows \ system32 \ drivers \ etc folder find the hosts file and open it with notepad (Windows 9x/me System in C: \ find in Windows Folder)
      2. Add a single line of records according to the format of the IP address domain name. For example
        72.14.219.190 www.hbcms.net
        Note that there must be no space before the IP address. There must be at least one space between the IP address and the domain name.
        After modification, remember to save the file.
      3. How do I know that the IP address of the domain name has taken effect?
        1. On your computer, follow these steps: start --> Run --> Enter cmd --> Ping domain name --> press enter to view the results
        2. The result is similar to reply from 220.181.31.183: bytes = 32 time = 79 Ms TTL = 53.
          The 220.181.31.183 in the middle is the IP address of the domain name.
      4. Close all browsers and open them again to test whether the domain name you just added can be accessed normally.
      5. If the access is abnormal, follow the 3 steps to check whether the domain name you just set corresponds to the correct IP Address

    What is a domain name resolution file hosts? What is the function?

    1. Accelerate domain name resolution

    For websites that require frequent access, we can configure the ing between the domain name and IP address in hosts, so that when we enter the domain name computer, we can quickly resolve the IP address, instead of requesting DNS servers on the network.

    2. Facilitate LAN users

    In the LAN of many organizations, servers are provided for users. However, because DNS servers are rarely set up in Lan, it is quite troublesome for many people to access these services to enter hard-to-remember IP addresses. Now we can give these servers an easy-to-remember name, and then create an IP ing in hosts. In this way, we can enter the name of this server for future access.

    3. Website Blocking

    Many websites install various plug-ins on your computer without your consent. Some may be Trojans or viruses. For these websites, we can use hosts to map the Domain Name of the website to the wrong IP address or the IP address of our computer, so that no access is required. For example, if you do not want to access www.xxxx.com, write the following content in hosts:

    127.0.0.1 www.xxxx.com # blocked websites
    0.0.0.0 www.xxxx.com # blocked website

    In this way, the computer resolves the domain name to the local machine or the wrong IP address, to achieve the purpose of blocking.

    4. Smooth system connection

    For Lotus servers and some database servers, if you enter an IP address directly during access, it cannot be accessed. You can only enter the server name to access the server. Then we configure the hosts file so that the server name can be successfully connected.

    Finally, it should be pointed out that the hosting configured in the hosts file is static. If the computer on the network changes, update the IP address in time; otherwise, the IP address cannot be accessed.

    5. Force a domain name to correspond to an IP address

     

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.