1. 38

This really surpised me - I thought that localhost was already defined by the standards to be loopback on 127.0.0.0/8 or ::1/128

  1.  

  2. 6

    Surprised me as well, however I really like it as a formal standard including subdomains so one can use it reliably. Can see myself having apps listening to appname.localhost giving you a meaningful and rememberable name. Of course to my current knowledge this would still need data routing through an app proxy if the same TCP port is used.

    1. 5

      Ideally we could map .localhost. subdomains to different addresses in 127.0.0.0/8 and use them without conflict.

    2. 3

      Has anyone tried entering a different IP for ‘localhost’ in their /etc/hosts with interesting results?

      Someone notes here: https://unix.stackexchange.com/questions/109245/hostname-and-ip-address-mapping-in-etc-hosts/109247#109247 that “You do not want to change localhost to map to anything other than 127.0.0.1, this can have strange and subtle effects on many things”

      1. 6

        I was about to say that’s useful, but I’m thinking of something slightly different. Anyway, various systems at various times have had bugs where they would route traffic received on an external interface to 127. So somebody has an unsecured mongo running on localhost. I delete my own loopback address, add a route to 127 via the target’s public IP, and voila, I’m connected to the mongo. Something to test.