What does bind to address mean?

I have to 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?


  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer. – Ron Maupin Dec 15 '19 at 3:50
  • i am still not satisifed with the existing answer i will research it further and will accept it or provide my own :) – Roshan Rimal Dec 15 '19 at 10:44
  • That answer is actually correct. You could also ask on Stack Overflow, where this question really should be, and where there are many network-savvy programmers. – Ron Maupin Dec 15 '19 at 17:57

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 '19 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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