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


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" in the terminal (command prompt) returns the IP address:

C:\Users\Username>ping localhost

Ping is executed for host name [] with 32 bytes of data:
Reply from Bytes=32 Time<1ms TTL=128
Reply from Bytes=32 Time<1ms TTL=128
Reply from Bytes=32 Time<1ms TTL=128
Reply 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?

If "localhost" is used as URL in the browser for the call, a connection to the local PC takes place. "Localhost" is often used by developers to run or test network programs or websites on their own computer. If programs consist of a client program and a server service and both components are installed on the same device, the client can access the server service via the network protocol (TCP/IP) with the name "localhost". In addition, "localhost" can also be misused as a target for a redirect in the hosts file to block certain websites, see: Blocking certain websites: Redirecting websites.

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