Live data from Hacker News

Internet Draft: Let 'localhost' be localhost

tools.ietf.org

21–30 of 179 posts

Re: Internet Draft: Let 'localhost' be localhost

#21
post #14
post #13

Earlier quoted context omitted.

Pretty sure it's already called a "draft."

Hm, I'm not familiar with that acronym.

It stands for Document Requesting All Faults and Technicalities. (Source: I have a PhD in speaking out of my ass.)

Re: Internet Draft: Let 'localhost' be localhost

#22
post #11

Can anybody with more knowledge point out techniques that this would break? Are there any software or networking patterns that currently rely on localhost _not_ resolving to the loopback? EDIT: The RFC mentions that MySQL currently differentiates between the two, but that's it.

Hmm I guess people may use IPs other than 127.0.0.1 like 127.0.0.2 for Docker or maybe VPN/VM shenanigans...

Re: Internet Draft: Let 'localhost' be localhost

#25

   First, the lack of confidence that "localhost" actually resolves to
   the loopback interface encourages application developers to hard-code
   IP addresses like "127.0.0.1" in order to obtain certainty regarding
   routing.  This causes problems in the transition from IPv4 to IPv6
   (see problem 8 in [draft-ietf-sunset4-gapanalysis]).
That does remind me of the times I was dealing with weird connection issues in some critical services.

It turned to be related to the use of "localhost" in the configuration. It resolves to ipv6 on some systems and that breaks everything because the target app is only listening to the ipv4 address.

Went as far as removing all references to localhost and added lint errors in the configuration system so that noone could ever be able to give localhost as a setting in anything.

Re: Internet Draft: Let 'localhost' be localhost

#26
There was no RFC for localhost yet?! That's pretty surprising... That this RFC have any practical meaning? People didn't actually register localhost. domain, did they? Is there an actual line of code that this should change? Are they just trying to promote writing localhost instead of 127.0.0.1?

Re: Internet Draft: Let 'localhost' be localhost

#27
post #18
post #2

If this doesn't happen or takes too long, there's always lacolhost.com and *.lacolhost.com. I own this domain, have registered it out until 2026 and vow that the domain and all subdomains will always redirect to localhost. It's easy to type and easy to remember and should always do a good job of expressing intent of usage.

I wonder if lacolhost.com is just an A record pointing to 127.0.0.1, what would be the use-case to use that instead of just using 127.0.0.1? Is it that some systems require a domain to be used/tested?

lacolhost.com should also resolve to the ipv6 record for localhost.

Being able to test locally while using the full internet name resolution system is a valuable thing as well. Though if this is your use case I wouldn't trust lacolhost: register your own domain.

Re: Internet Draft: Let 'localhost' be localhost

#28

Why couldn't they just redirect "localhost" at the DNS level to 127.0.0.1?

Well, because that IP isn't what localhost is supposed to be pointed to. It's supposed to point at 127.0.0.1. The IP you mentioned is more likely to be the IP of the router you're connected to.

Usually 127.0.0.1 is limited to the computer's internal network via a loopback network interface and `localhost` should be resolving just to that, but this RFC makes it so that no matter what `localhost` will point locally instead of somewhere else which helps people who want to bind to just the internal loopback and nothing else.

Re: Internet Draft: Let 'localhost' be localhost

#29

   The domain "localhost.", and any names falling within ".localhost.",
   are known as "localhost names".  Localhost names are special in the
   following ways […]
Is this not implemented on macOS or am I just misunderstanding?

     ~ ping test.localhost
   ping: cannot resolve test.localhost: Unknown host
     ~ ping localhost.test
   ping: cannot resolve localhost.test: Unknown host

Re: Internet Draft: Let 'localhost' be localhost

#30
this reminds me of a class I went to at a major company in 1999, we had problems following the setup instructions which included going to localhost/db-admin-path, after some sleuthing it turned out somebody 'in corporate' on the network we were using had named their computer localhost.
Post reply on HN