local loopback address

local loopback address

 Among the special reserved IP addresses is the local loopback address. Here, we will explain the local loopback address.

 The local loopback address is "127.0.0.1". This address is a virtual IP address representing itself. Any IP address within the range of "127.0.0.1 to 127.255.255.254" can be used.

* However, "127.0.0.0" and "127.255.255.255" are excluded.

 The local loopback address can be "127.0.0.2", "127.0.0.3", or anything within the range, but generally only "127.0.0.1" is used.

 This local loopback address is used by network terminals to check if TCP/IP is enabled and to connect to services running on top of itself.

You can also refer to this address by the name "localhost".

 In recent OS, TCP/IP is standard and does not need to be installed. Windows 9x required the user to install the TCP/IP protocol.

 Basically, checking whether TCP/IP is enabled is becoming less necessary than in the past. Check if the NIC is working properly when the NIC is replaced or added.

Start a command prompt to easily experience the local loopback address.

Below is an image of Windows Vista.

To launch Command Prompt, select it from the menu or directly type "cmd" to launch it.

* Start by typing "cmd" in "Specify file and run" depending on the OS.

 Then

C:\>ping 127.0.0.1

Try typing

 A response is back.

Next, try entering "ping 127.0.0.2" to see if a response comes back.

C:\>ping 127.0.0.2

 Try typing "ping localhost" to see if you get a response.

 A response will come back.

hosts file

"localhost" is defined in the following file:

C:\Windows\System32\drivers\etc\hosts

Contents of the hosts file

# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
::1 localhost

The part shaded in yellow above is the definition.

It also uses the local loopback address when verifying that its own services are working.

 For example, if it's running as a web server, you can start your browser and enter "http://localhost/" in the URL to connect to the service and see how it works.