How can I access a host through a computer name?

Source: Internet
Author: User
This is not a new article, but I encountered this problem some time ago due to work requirements.
We have set up a website. For some reason, we can only access the website through the computer name (host name), but not through the IP address.
In some cases, users in our LAN are accessible, but some users are not. For this reason, I checked some information and found the solution. Originally, there was a file named hosts in the C: \ windows \ system32 \ drivers \ etc directory. The content is as follows: 1 # Copyright (c) 1993-1999 Microsoft Corp.
2 #
3 # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
4 #
5 # This file contains the mappings of IP addresses to host names. Each
6 # entry shoshould be kept on an individual line. The IP address shold
7 # be placed in the first column followed by the corresponding host name.
8 # The IP address and the host name shocould be separated by at least one
9 # space.
10 #
11 # Additionally, comments (such as these) may be inserted on individual
12 # lines or following the machine name denoted by a' # 'symbol.
13 #
14 # For example:
15 #
16 #102.54.94.97 rhino.acme.com # source server
17 #38.25.63.10 x.acme.com # x client host
18
19127.0.0.1 localhost

We can see that 127.0.0.1 localhost. In the last line is the IP address, followed by the host name corresponding to this IP address. Therefore, access to 127.0.0.1 and localhost are both local hosts.
Now, we add a line later: 1211.143.112. * techserver

Now we can access the host with the IP address 211.143.112. * Through the host name techserver.

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.