When we talking about computing, we can’t forget the localhost, a term meaning this computer. The localhost can be used to access the network features on the host that is configured by looping interface.
Using this interface, no physical network adapter is required. The local looping mechanism can be useful for test during development software, independently of any network configuration.
By example, if a computer has been configured to host a website, you can access the home page directly typing http://localhost in your web browser.
In the most of systems, localhost have the IPv4 address 127.0.0.1, which is the most used IPv4 and the IPv6 address as ::1.
The domain localhost is not available to register and it’s reserved for top-level domains only, avoiding possible confusion to define domain name. This restriction in domain names with the attribution localhost is defined by IETF standards.
IPv4 networks reserve the addresses range 127.0.0.0/8 for looping purposes. This means that all packets that are sent to any of 16,777,214 addresses (from 127.0.0.1 at 127 255 255 254), looping return. In the case of IPv6, there is only one address for this: the IP :: 1.
The name resolution of localhost of one or more IP addresses is set by the following lines in the OS’s host file:
127.0.0.1 localhost ::1 localhost
Usually this file can be found in the folder:
The localhost can be mapped also in other IPv4 addresses. Other aliases may be assigned to any address looping. For example, you can set in these lines your localhost like “dog”. So whenever you type “dog” will have the same effect as you would by typing “localhost”. In our example, would be enough to add the following line and save the host’s file:
So when you type http://dog in the web browser will access the same page that is set to localhost.
The process of sending every packet to a looping address is run by stack link-layer TCP/IP protocols. The packets are not delivered to network interface or driver devices, allowing the testing of software without the need for any network interface.
As well as other packages that pass through the TCP/IP stack, looping packets transmit the IP address and port number to which they were addressed. So the receivers from the other side can respond as the destination specified looping.
For example, an HTTP service can route packets addressed to 127.0.0.99:80 and 127.0.0.100:80 to different Web servers, or to a single server that return different pages in each case. To simplify these tests is that there is the possibility to change or create aliases for looping.
This translation had the help of Google Translate. If you find an error, let us know by sending a comment.