- Localhost and Loopback IP Address

Hispanic man using laptop.
Blend Images/Hill Street Studios/Brand X Pictures/Getty Images

The IP address is a special purpose IPv4 address reserved for use on a networked computer. is also called a computer's loopback address.

How Works

All messages generated by TCP/IP application software contain IP addresses for their intended recipients; TCP/IP recognizes as a special IP address. The protocol checks each message before sending it onto the physical network and automatically re-routes any messages with destination of back to the receiving end of the TCP/IP stack.

To improve network security, TCP/IP also checks incoming messages arriving on routers or other network gateways and discards any that contain loopback IP addresses. This prevents a network attacker from disguising their malicious network traffic as coming from a loopback address.

Application software typically uses this loopback feature for local testing purposes. Messages sent to loopback IP addresses like do not reach outside to the local area network (LAN) but instead are delivered directly to the TCP/IP receive queues as if they had arrived from an outside source.

Loopback messages contain a destination port number in addition to the address. Applications can use these port numbers to subdivide test messages into multiple categories.

Loopback Addresses in IPv6

Internet Protocol v6 (IPv6) implements the same concept of a loopback address as IPv4. Instead of, IPv6 represents its loopback address as simply ::1 (0000:0000:0000:0000:0000:0000:0000:0001) and, unlike IPv4, does not allocate a range of addresses for this purpose.

About Localhost

The name localhost also carries a special meaning in computer networking used in conjunction with  Computer operating systems maintain an entry in their hosts file associating the name with the loopback address, enabling applications to create loopback messages via name rather than a hardcoded number. vs. Other Special IP Addresses

IPv4 reserves all addresses in the range up to for use in loopback testing, alhough is (by historical convention) the loopback address used in almost all cases. and other network addresses do not belong to any of the private IP address ranges defined in IPv4. Individual addresses in those private ranges can be dedicated to local network devices and uses for inter-device communication, whereas cannot. 

Those studying computer networking sometimes confuse with the address While both have special meanings in IPv4, does not provide any loopback functionality.