The difference between 127.0.0.1 and localhost and IP

Source: Internet
Author: User

The difference between 127.0.0.1 and localhost and IP

May 18, 2014

localhost

No networking
Do not use network cards and are not restricted by firewalls and network cards
Native access

General use 本地套接字文件AF_UNIX of the application general conventions are used localhost to prioritize local socket connections. mysqlclient and MySQLserver are such conventions

127.0.0.1

No networking
Network card transmission, restricted by firewalls and network cards
Native access

127.0.0.1 is the IP address inside the host IP stack: The windows/unix IP address that is found inside the IP stack is 127.0.0.l immediately returned to the application layer.

192.168.*.*

Networking
Network card transmission, restricted by firewalls and network cards
Native or local area network access

Native IP

Networking
Network card transmission, restricted by firewalls and network cards
Native or local area network or external access

Why localhost does not use a network card but the hosts have records.

When parsing is convenient, pointing to applications that need to resolve to IP will still use/etc/hosts to resolve to 127.0.0.1 such as Ping

For example, when accessing http://localhost a browser because of protocol-based tcp/ip , you need to look up the host table

And we used to mysql specify by default is locaLhost that this uses /tmp/mysql.sock the本地套接字文件AF_UNIX

This article is from: Http://i.joymvp.com, the original address: http://i.joymvp.com/%E6%8A%80%E6%9C%AF/routing-traffic-localhost.html, thank the original author to share.

The difference between 127.0.0.1 and localhost and IP

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.