What does bind to address mean?

I have come to know that if an application bind to then it means listen on all interface but it doesn't make much sense to me. Can someone explain bind address and what does binding to a particular ip address mean.

Also is it the network id or ip specific address that you use?



1 Answer 1


This terminology comes from network programming:

A computer typically has one IP address for each network card. A computer may have multiple IP addresses for a network card (this is even the normal case when using IPv6). And a computer has the "localhost" address ( when using IPv4).

This means that a computer has multiple IP addresses.

By "binding" a socket (or a similar operating-system object) to an address, you tell the operating system which of the addresses of a computer shall be used together with this socket:

Let's say a computer has two IP addresses: and

If you bind a socket for incoming TCP connections to, it cannot accept incoming TCP connections with a destination address of but only connections to

If you bind a socket to, it will accept data (such as TCP connections) for all IPv4 addresses of the computer the software is running on. (The same is true for the address 0::0 when using IPv6.)

  • Don't forget the logical loopback address that a host always has, even without a network interface. Binding to that enables local-only services.
    – Zac67
    Jun 15, 2019 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.