Custom domain name resolution

Source: Internet
Author: User
Tags domain name server

Case Analysis:
When we can connect to the network and ping the IP address of the other party, but cannot access through the domain name. This is the issue of domain name resolution.

Many users know that there is a hosts file in the window system (without a suffix). in Windows 98, this file is located in the Windows directory, and in Windows 2000/XP, it is located in C: \ windows \ system32 \ drivers \ etc directory. This file is actually a plain text file, which can be opened using common text editing software such as Notepad.

Open the hosts file in Notepad. First, you can see Microsoft's description of this file. This file works according to TCP/IP for Windows standards. Its role is to include the ing between the IP address and host name, it is a rule for ing IP addresses and host names. Each segment must contain only one ing relationship, and the IP addresses must be placed at the beginning of each segment, enter the ing host name. For this section of the ing description, use "#" to separate and then use text description.

How hosts works in Windows:
We know that to access the website on the network, first through the DNS server to the network domain name ( into 61. xxx ip address, our computer can access. For each domain name request, we need to wait for the Domain Name Server to return IP information after resolution, so that the network access efficiency will be reduced, and the hosts file can improve the resolution efficiency. According to Windows System regulations, before a DNS request is made, Windows system will first check whether there is this address ing in its hosts file. If so, this IP address ing is called, if no domain name resolution is provided to a known DNS server. That is to say, the request level of hosts is higher than that of DNS.

What is the role of the hosts file in actual use?

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 don't want to access the, write the following in hosts:
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.

C: \ windows \ system32 \ drivers \ etc
Join: localhost bmcserver


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: 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.