Live data from Hacker News

Internet Draft: Let 'localhost' be localhost

tools.ietf.org

61–70 of 179 posts

Re: Internet Draft: Let 'localhost' be localhost

#61
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.

Anyone using DNS search lists to have localhost resolve to e.g. localhost.example.com would potentially have problems. Obviously this is a pretty weird thing to intentionally do, but it currently gives you a quick way to get around certain issues. Obviously this is ugly, but in some ways that actually makes breaking it more problematic: Things which this breaks are likely to be things that are difficult to fix.

Re: Internet Draft: Let 'localhost' be localhost

#62
post #60
post #58

Earlier quoted context omitted.

Within " .localhost. "... www.localhost.mydomain.com?

The trailing "." signifies the end of the domain name, so your example domain would be unaffected.

> Application software MUST NOT use a searchlist to resolve a localhost name.

Re: Internet Draft: Let 'localhost' be localhost

#66
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.

Could it be you were hanging on #css on irc on a network I can't remember more than 10 years ago ? (there usually were only 5 of us there). I seem to remember someone owning a domain like that.

Re: Internet Draft: Let 'localhost' be localhost

#68

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 s…

Hello me from last week. Had exactly this bug, sometimes nginx couldn't connect to the backend (but very rarely, and not reproducible on demand), which I eventually tracked to the fact that localhost sometimes resolved to ::1 instead of 127, which is what the backend was listening on. Still don't understand why it was only like 1 in 1000 requests, and not every or every other request. Just one more slice of ipv6 myst…

I've had weird errors like that where two DNS servers were giving answers to my query rather than just the one that I intended. This will never happen when using TCP but when using UDP it may happen. Every now and then the packets would receive in a different order and then I'd be paged because some app fell over. Fun times.

Re: Internet Draft: Let 'localhost' be localhost

#70

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

Trust: there's no “DNS level” which you can reason about reliably across the wide range of networks people use. Developers would still get bug reports because some ISP resolved localhost to the IP address of their search / ad page, or a dodgy home router returned its setup page, etc. Lest that seem contrived, there are major ISPs – national level in Europe – which ran transparent HTTP proxy-caches which stored pages for years beyond their expiration date. I have zero confidence that some ISP wouldn't through incompetence or marketing have localhost resolve to something you don't expect.

Building it into the network stack means that entire class of errors stops happening.

Post reply on HN