call localhost: IP address "", "::1" | what is localhost?

Diese Seite gibt es auch in Deutsch

If the computer were a house, "localhost" would be something like "home". In a nutshell, "localhost" is the network name for your own device: for itself.

DNS: localhost

The connection to another device in the network is usually established via its name (host name, domain, DNS) and the unique IP address associated with it. This applies both to the local network (LAN) and to the Internet. A computer has its own computer name (host name) and also the name "localhost", as well as the associated IP address or, when using IPv6, the address "::1". The IP address (or ::1) is used by the computer to establish a connection with itself. Thus, neither the IP address nor the host name must be known for a connection to the own computer. Responsible for receiving the connection is the loopback interface, which does not send the connection via the network card, but establishes it directly with the ports opened on the computer. The name localhost is reserved as a top-level domain name (TLD), this was defined in the IETF standard: (Special-Use Domain Names) and the use of the IP address in the document: (Special Use IPv4 Addresses).


A test on "localhost" returns the IP address:

C:\Users\Username>ping localhost

Ping is executed for host name [] with 32 bytes of data:
Response from Bytes=32 Time<1ms TTL=128
Response from Bytes=32 Time<1ms TTL=128
Reply from Bytes=32 Time<1ms TTL=128
Response from Bytes=32 Time<1ms TTL=128

Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0.
    (0% loss),
Approx. times in milliseconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

For localhost to work, the IP address must of course appear in the routing:

C:\Users>route print
Interface list
 20...xx xx xx xx xx ......Ethernet Connection
  1...........................Software Loopback Interface 1

IPv4 route table
Active routes:
     Network destination Network mask Gateway Interface Metric
... On connection 331 On connection 331 255.255 On connection 331
... 255.255.255 On connection 331 255.255.255 On connection 281
Permanent routes:

IPv6 route table
Active Routes:
 If metric network destination gateway
  1 331 ::1/128 On connection
  1 331 ff00::/8 On connection
Permanent routes:

If you take a closer look at the routing table, you can see that not only is used for loopback, but the complete network, i.e. more than 16 million addresses.

For details about the routing table, see also: Adjusting the routing table: WLAN and LAN network cable at the same time - Internet access

what is "localhost" used for?

  • "localhost" is used for example by developers to run or test network programs or websites on their own computer. For the call localhost is then used as URL in the browser.
  • For programs that consist of a client and a server part and communicate via the network protocol (TCP/IP): "localhost" can then be used by the client program for communication with the server service. These programs then usually also offer the possibility that other clients can access the server service via the network, for this of course not localhost is then used, but the host name or DNS.
  • "Localhost" can also be misused as a target for redirection in the hosts file, see Blocking certain Internet pages: Redirecting web pages.
positive Bewertung({{pro_count}})
Rate Post:
{{percentage}} % positive
negative Bewertung({{con_count}})

THANK YOU for your review!

Questions / Comments

By continuing to browse the site, you agree to our use of cookies. More Details