I know that ~ are the loopback IP addresses for most modern operating systems, and these IP addresses can be used to refer to our own computer.

But what's It seems it also refers to the local computer, so what's the difference?

And, could you explain the following IP connections for me:

screenshot of netstat -an output


5 Answers 5


The only thing is that you're not saying "all addresses should have access" -- that's done in your firewall(s) and/or the server software and/or other security layers like tcpwrappers., in this context, means "all IP addresses on the local machine" (in fact probably, "all IPv4 addresses on the local machine"). So, if your web server machine has two IP addresses, and, and you allow a web server daemon like Apache to listen on, it will be reachable at both of those IP addresses. But only to what can contact those IP addresses and the web port(s).

Note that, in a different context (routing) usually means the default route (the route to "the rest of" the internet, aside from routes in your local network etc.).

  • so you mean that webserver's socket is bound to any available addresses when it listens on ?
    – onmyway133
    Jul 17, 2013 at 3:02
  • 2 means the default route only if it is accompanied by prefix /0 (or netmask
    – minmaxavg
    Dec 11, 2015 at 12:28
  • 2
    To be noted: if some process listens on, it will be reachable at IP adresses of all the machine's network interfaces which include the currently configured address of the loop back interface. But if the process listens only on a port <portNumber> of a loopback address, e.g., and then the process is only reachable from the same machine by targeting exactly<portNumber>. Try this python tool to play! Dec 12, 2016 at 18:04

When a service is listening on this means the service is listening on all the configured network interfaces, when listening on the service is only bound to the loopback interface (only available on the local machine)


The IP address can have very different meanings, depending on where it's used.

  • It's not a valid address to be given to an actual network interface, along with any other address in the subnet (i.e. any address starting with 0.).
  • It can't be used as the source address on any IP packet, unless this happens when a computer still doesn't know its own IP address and it's trying to acquire one (classic example: DHCP).
  • If used in a routing table, it identifies the default gateway; a route to is the default one, i.e. the one used when there is not any more specific route available to a destination address.
  • Lastly, when seen in the output of the netstat command (which is what you asked for), it means that a given socket is listening on all the available IP addresses the computer has; when a computer has more than one IP address, a socket can be bound only to a specific address and port pair, or to a port and all addresses; if you see an IP address there, it means that socket is listening only on that port and that specific address; if you see, it means it's listening on that port on all addresses of the machine, including the loopback one (
  • 3
    What does it mean if you curl Is curl actually contacting and sending a request through available interfaces? How does it know which interface is the right one? I understand how a server might listen on all interfaces, but what is the mechanism for a client to request all interfaces such as when I do curl or curl [::]. Jun 11, 2014 at 9:05
  • 1
    The OS will very likely block you from doing that, as it doesn't just make sense from the networking perspective. Trying to ping on a Windows system results in an error message.
    – Massimo
    Jun 11, 2014 at 13:01
  • curl yields connection refused on Arch Linux. ping, on the other hand, seems to be an alias for ping which works fine. Aug 11, 2017 at 9:53
  • @MatthiasBraun the connection refused might be because curl by default try to connect to port 80/tcp. Try to find your open ports with nmap -sV localhost and then for eg if 631/tcp: curl
    – Pablo A
    Mar 2, 2018 at 16:00

Lee B's answer is right on, but here's some relevant RFCs in case you're interested.

From RFC1122, Section

We now summarize the important special cases for Class A, B, and C IP addresses, using the following notation for an IP address:

            { <Network-number>, <Host-number> }

            { <Network-number>, <Subnet-number>, <Host-number> }


          (a)  { 0, 0 }

             This host on this network.  MUST NOT be sent, except as
             a source address as part of an initialization procedure
             by which the host learns its own IP address.

Just that, "this host on this network"... as Lee B's answer states this translates to all available IP addresses on your host. Hosting a service on will automatically host that service on every addressable interface.

From RFC5735: - This block is assigned for use as the Internet host loopback address. A datagram sent by a higher-level protocol to an address anywhere within this block loops back inside the host. This is ordinarily implemented using only for loopback. As described in [RFC1122], Section, addresses within the entire block do not legitimately appear on any network anywhere.

The difference between and the loopback address is that the loopback address is designed to allow a fully functioning IP interface within the host itself, regardless of what the rest of the networking setup, if any, looks like. Any traffic sent to the loopback device is immediately received on it. It's not so much that the loopback network "refers" to your own host... it's more of like you have a mini network segment in your host that devices, processes and sockets and can open and connect to.


In simple terms: Listening on means listening from anywhere that has network access to this computer, for example, from this very computer, from local network or from the Internet, while listening on means only listen from this very computer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .