What is 127.0.0.1? What about localhost?

Source: Internet
Author: User

I believe many people will access this IP address 127.0.0.1. Maybe you will askWhat is 127.0.0.1?In fact, 127.0.0.1 is a return address, which refers to a local machine and is generally used for testing. We usually use ping127.0.0.1 to check whether the local IP address or TCP port is abnormal. If you can ping the port, it can be used normally.

In most cases, localhost is used to point to the local IP address 127.0.0.1. There is a configuration file in the operating system that binds localhost with 127.0.0.1. It can be understood as the meaning of the local host. What is a hosts file? Where is the hosts file? This articleArticle.

127.0.0.1 is often used by website builders.

What is the difference between 127.0.0.1 and localhost?

I believe some people will say it is a local IP address. Some people once said that 127.0.0.1 is better than localhost, and it can reduce the resolution once. In fact, there is a difference between the two.

Localhost is also called local. The correct explanation is: the address of the local server 127.0.0.1 in windows and other systems is: local server)

Localhot (local) is transmitted without a Nic! This is important because it is not restricted by network firewalls and network adapters.
127.0.0.1 is transmitted through the NIC and depends on the NIC. It is subject to network firewall and nic restrictions. General settingsProgramLocalhost is the best for local services.
Localhost will not be resolved to an IP address (if you are not familiar with the Resolution, please refer to what DNS means ?), It does not occupy Nic or network resources. Sometimes you can use localhost, but you cannot use 127.0.0.1. This is the case. Assume that when localhost is accessed, the current user's permission on the local machine is granted by the system. When IP is used, the local machine accesses the local machine through the network, which may involve the permissions of network users.

Http://justjavac.javaeye.com/

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.