Why is localhost IP 127.0.0.1?

I wondered what is the origin of the decision to make localhost‘s IP address 127.0.0.1. What is the “meaning” of 127? what is the “meaning” of 0.0.1?

Answer

127 is the last network number in a class A network with a subnet mask of 255.0.0.0. 127.0.0.1 is the first assignable address in the subnet. 127.0.0.0 cannot be used because that would be the wire number. But using any other numbers for the host portion should work fine and revert to using 127.0.0.1. You can try it yourself by pinging 127.1.1.1 if you’d like. Why they waited until the last network number to implement this? I don’t think it’s documented.

Attribution
Source : Link , Question Author : Roee Adler , Answer Author : John T

Leave a Comment