Search code examples
weburllocalhost

How many maximum ports can there be on localhost?


What is the maximum number of localhost one can have on PC? So I know that if the localhost is only like localhost:2020 then there would be 10000 localhost that you can have on a PC. But is it possible to have that many localhost?

Edit: I am editing this after 27 months, back then I was completely unaware of the technicalities and grammar revolving around the internet. For example, I now understand that instead of saying "how many localhosts", I should have said, "What is the maximum number of ports...". Back then I did not have as much knowledge on how the internet works. Now I now exactly what localhost means.

Also the answer to the question is 65536 ports. This may sound like a random number (it probably was random to me 27 months ago) but this is because of binary codes and how computers store data.

And as mentioned earlier, due to grammatical errors, googling the question would not give a understandable answer as google probably did not understand by what I meant by "how many localhosts".

Answer is 65536 ports


Solution

  • Answer - 1 localhost and (1-65535) endpoints for communicating.

    The localhost is the host name of the computer. The host has communication endpoints called ports. The local host has 1-65535 ports that technically can be used.