call localhost: IP address "127.0.0.1", "::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 127.0.0.1 or, when using IPv6, the address “::1”. The IP address 127.0.0.1 (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: tools.ietf.org/html/rfc6761 (Special-Use Domain Names) and the use of the IP address 127.0.0.1 in the document: tools.ietf.org/html/rfc5735 (Special Use IPv4 Addresses).

IP: 127.0.0.1

A test on “localhost” returns the IP address: 127.0.0.1:

C:\Users\Username>ping localhost

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

Ping statistics for 127.0.0.1:
    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 127.0.0.1 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
          0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.22 25
...
        127.0.0.0 255.0.0.0 On connection 127.0.0.1 331
        127.0.0.1 255.255.255.255 On connection 127.0.0.1 331
  127.255.255.255 255.255 On connection 127.0.0.1 331
...
  255.255.255.255 255.255.255 On connection 127.0.0.1 331
  255.255.255.255 255.255.255 On connection 192.168.0.22 281
===========================================================================
Permanent routes:
  None

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

If you take a closer look at the routing table, you can see that not only 127.0.0.1 is used for loopback, but the complete 127.0.0.0 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!

Updated: 2022-12-27 von Bernhard | Übersetzung Deutsch |🔔 | Comments:0

cmd Portscan - Test devices on the network for their services. | Network | LAN / WiFi Speed Test: Test network speed with iPerf

Top articles in this section


Ping with Port | cmd vs. PowerShell: Test-Netconnection

As is well known, the tool ping can be used to test the access to a certain network device and its response time. Not all devices will respond to a ping, but they may respond to a particular Tcp-Port if a particular network service is provided through it. Windows PowerShell allows you to test a specific port using Windows board tools. The psping tool can also measure the response time to a specific port.


Uninterrupted WiFi: Roaming (Fast Transition)

The marketing term "mesh WiFi" often refers to the desire for a WiFi that simply works everywhere in the house. But what actually is a mesh WiFi? And what is really needed for WiFi to work everywhere and even when switching from one receiving station to another? My setup consists of two access points, which as a unit provide a single WiFi SSID. As access points I use devices from different manufacturers and OpenWrt as firmware. The access points provide uninterrupted reception when I move from o...


show active network connections and processes | Windows

For a quick overview of which programs or services have an active network connection, they can be listed via simple commands or monitored and analyzed via specific tools. 

Questions / Comments


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