Localhost
Encyclopedia
In computer networking, localhost (meaning this computer) is the standard hostname
given to the address of the loopback
network interface. The name is also a reserved top-level
domain name
(cf. .localhost
), set aside to avoid confusion with the narrower definition as a hostname
.
On modern computer systems, localhost as a hostname translates to an IPv4
address
in the 127.0.0.0/8 (loopback
) net block
, usually 127.0.0.1, or ::1 in IPv6
.
Localhost is specified where one would otherwise use the hostname of a computer. For example, directing a web browser installed on a system running an HTTP server tohttp://localhost will display the home page of the local web site, provided the server is configured to service the loopback interface.
Communicating with the loopback interface in an identical manner as with another computers on the network, but bypassing the local network interface hardware, it is useful for the purposes of testing software. Using the DCHP's own internal command to force the loopback.
Connecting to locally hosted network services, such as a computer game server
, or for other inter-process communications, can be performed through loopback addresses in a highly efficient manner.
The Internet Engineering Task Force
(IETF) Internet Standard
document STD-2 series (e.g., RFC 1700) reserved the 127.0.0.0/8 address block
for loopback purposes. until such definitions were updated exclusively through the Internet Assigned Numbers Authority
(IANA) website. A later IETF document, Special-Use IPv4 Addresses (RFC 3330) describes the usage of the IPv4 address block 127.0.0.0/8 for loopback purposes. It is therefore excluded from assignment by a Regional Internet Registry
or IANA
.
For IPv4 communications, the virtual loopback interface of a computer system is normally assigned the address 127.0.0.1 with subnet mask 255.0.0.0. Depending on the specific operating system in use (notably in Linux
and Microsoft Windows) and the routing mechanisms installed, this populates the routing table
of the local system with an entry so that packets destined to any address from the 127.0.0.0/8 block would be routed internally to the network loopback device.
In IPv6, on the other hand, the loopback routing prefix ::1/128 consists of only one address ::1 (0:0:0:0:0:0:0:1 in full notation), the address with a one at its least significant bit and zero otherwise) is explicitly defined as the loopback address, though additional addresses may be assigned as needed to the loopback interface by the host administrator.
Any IP datagram
with a source or destination address set to a loopback address must not appear outside of a computing system, or be routed by any routing device. Packets received on an interface with a loopback destination address must be dropped.
One notable exception to the use of the 127/8 network addresses is their use in Multiprotocol Label Switching
(MPLS) traceroute error detection techniques (RFC 4379) in which their property of not being routable provides a convenient means to avoid delivery of faulty packets to end users.
Hostname
A hostname is a label that is assigned to a device connected to a computer network and that is used to identify the device in various forms of electronic communication such as the World Wide Web, e-mail or Usenet...
given to the address of the loopback
Loopback
Loopback describes ways of routing electronic signals, digital data streams, or flows of items from their originating facility back to the source without intentional processing or modification...
network interface. The name is also a reserved top-level
Top-level domain
A top-level domain is one of the domains at the highest level in the hierarchical Domain Name System of the Internet. The top-level domain names are installed in the root zone of the name space. For all domains in lower levels, it is the last part of the domain name, that is, the last label of a...
domain name
Domain name
A domain name is an identification string that defines a realm of administrative autonomy, authority, or control in the Internet. Domain names are formed by the rules and procedures of the Domain Name System ....
(cf. .localhost
.localhost
The name localhost is reserved by the Internet Engineering Task Force in RFC 2606 as a domain name label that may not be installed as a top-level domain in the Domain Name System of the Internet.-Reserved DNS names:...
), set aside to avoid confusion with the narrower definition as a hostname
Hostname
A hostname is a label that is assigned to a device connected to a computer network and that is used to identify the device in various forms of electronic communication such as the World Wide Web, e-mail or Usenet...
.
On modern computer systems, localhost as a hostname translates to an IPv4
IPv4
Internet Protocol version 4 is the fourth revision in the development of the Internet Protocol and the first version of the protocol to be widely deployed. Together with IPv6, it is at the core of standards-based internetworking methods of the Internet...
address
IP address
An Internet Protocol address is a numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing...
in the 127.0.0.0/8 (loopback
Loopback
Loopback describes ways of routing electronic signals, digital data streams, or flows of items from their originating facility back to the source without intentional processing or modification...
) net block
Classless Inter-Domain Routing
Classless Inter-Domain Routing is a method for allocating IP addresses and routing Internet Protocol packets. The Internet Engineering Task Force introduced CIDR in 1993 to replace the previous addressing architecture of classful network design in the Internet...
, usually 127.0.0.1, or ::1 in IPv6
IPv6
Internet Protocol version 6 is a version of the Internet Protocol . It is designed to succeed the Internet Protocol version 4...
.
Localhost is specified where one would otherwise use the hostname of a computer. For example, directing a web browser installed on a system running an HTTP server to
Communicating with the loopback interface in an identical manner as with another computers on the network, but bypassing the local network interface hardware, it is useful for the purposes of testing software. Using the DCHP's own internal command to force the loopback.
Connecting to locally hosted network services, such as a computer game server
Server (computing)
In the context of client-server architecture, a server is a computer program running to serve the requests of other programs, the "clients". Thus, the "server" performs some computational task on behalf of "clients"...
, or for other inter-process communications, can be performed through loopback addresses in a highly efficient manner.
The Internet Engineering Task Force
Internet Engineering Task Force
The Internet Engineering Task Force develops and promotes Internet standards, cooperating closely with the W3C and ISO/IEC standards bodies and dealing in particular with standards of the TCP/IP and Internet protocol suite...
(IETF) Internet Standard
Internet standard
In computer network engineering, an Internet Standard is a normative specification of a technology or methodology applicable to the Internet. Internet Standards are created and published by the Internet Engineering Task Force .-Overview:...
document STD-2 series (e.g., RFC 1700) reserved the 127.0.0.0/8 address block
Classless Inter-Domain Routing
Classless Inter-Domain Routing is a method for allocating IP addresses and routing Internet Protocol packets. The Internet Engineering Task Force introduced CIDR in 1993 to replace the previous addressing architecture of classful network design in the Internet...
for loopback purposes. until such definitions were updated exclusively through the Internet Assigned Numbers Authority
Internet Assigned Numbers Authority
The Internet Assigned Numbers Authority is the entity that oversees global IP address allocation, autonomous system number allocation, root zone management in the Domain Name System , media types, and other Internet Protocol-related symbols and numbers...
(IANA) website. A later IETF document, Special-Use IPv4 Addresses (RFC 3330) describes the usage of the IPv4 address block 127.0.0.0/8 for loopback purposes. It is therefore excluded from assignment by a Regional Internet Registry
Regional Internet Registry
A regional Internet registry is an organization that manages the allocation and registration of Internet number resources within a particular region of the world...
or IANA
IANA
IANA is an initialism that may stand for a number of things:*the Internet Assigned Numbers Authority, an organisation that oversees IP address, Top-level domain and Internet protocol code point allocations*the Iranian Agriculture News Agency...
.
For IPv4 communications, the virtual loopback interface of a computer system is normally assigned the address 127.0.0.1 with subnet mask 255.0.0.0. Depending on the specific operating system in use (notably in Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...
and Microsoft Windows) and the routing mechanisms installed, this populates the routing table
Routing table
In computer networking a routing table, or Routing Information Base , is a data table stored in a router or a networked computer that lists the routes to particular network destinations, and in some cases, metrics associated with those routes. The routing table contains information about the...
of the local system with an entry so that packets destined to any address from the 127.0.0.0/8 block would be routed internally to the network loopback device.
In IPv6, on the other hand, the loopback routing prefix ::1/128 consists of only one address ::1 (0:0:0:0:0:0:0:1 in full notation), the address with a one at its least significant bit and zero otherwise) is explicitly defined as the loopback address, though additional addresses may be assigned as needed to the loopback interface by the host administrator.
Any IP datagram
Datagram
A datagram is a basic transfer unit associated with a packet-switched network in which the delivery, arrival time, and order are not guaranteed....
with a source or destination address set to a loopback address must not appear outside of a computing system, or be routed by any routing device. Packets received on an interface with a loopback destination address must be dropped.
One notable exception to the use of the 127/8 network addresses is their use in Multiprotocol Label Switching
Multiprotocol Label Switching
Multiprotocol Label Switching is a mechanism in high-performance telecommunications networks that directs data from one network node to the next based on short path labels rather than long network addresses, avoiding complex lookups in a routing table. The labels identify virtual links between...
(MPLS) traceroute error detection techniques (RFC 4379) in which their property of not being routable provides a convenient means to avoid delivery of faulty packets to end users.