IP Address Explained

An explanation of the loopback IP address/localhost

The IP address is a special-purpose IPv4 address called localhost or loopback address. All computers use this address as their own but it doesn't let them communicate with other devices as a real IP address does.

Your computer might have the private IP address assigned to it so that it can communicate with a router and other networked devices. However, it still has this special address attached to it to mean "this computer," or the one you're currently on.

The loopback address is only used by the computer you're on, and only for special circumstances — unlike a regular IP address that is used to transfer files to and from other networked devices.

For example, a web server running on a computer can point to so that the pages can be run locally and tested before it's deployed.

How Works

Ping loopback addresses

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 a 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 doublecheck prevents a network attacker from disguising their traffic as coming from a loopback address.

Screenshot of DNS Server field in Windows 10 showing

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 but instead are delivered directly to the TCP/IP and 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.

Localhost and IPv6 Loopback Addresses

The name localhost also carries a special meaning in computer networking used in conjunction with Computer operating systems maintain an entry in their host's files associating a name with the loopback address, enabling applications to create loopback messages using a name rather than a hardcoded number.

Internet Protocol v6 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, it does not allocate a range of addresses for this purpose. vs. Other Special IP Addresses

IPv4 reserves all addresses in the range up to for use in loopback testing, although is (by convention) the loopback address used in almost all cases.

Check out our summary of IP Classes, Broadcast, and Multicast for more information about special IPv4 address ranges. 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 use for inter-device communication, whereas cannot.

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