TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Internet Draft: Let 'localhost' be localhost

594 pointsby beyangalmost 8 years ago

23 comments

user5994461almost 8 years ago
<p><pre><code> First, the lack of confidence that &quot;localhost&quot; actually resolves to the loopback interface encourages application developers to hard-code IP addresses like &quot;127.0.0.1&quot; 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]). </code></pre> That does remind me of the times I was dealing with weird connection issues in some critical services.<p>It turned to be related to the use of &quot;localhost&quot; 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.<p>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.
评论 #14950989 未加载
评论 #14950890 未加载
评论 #14952109 未加载
评论 #14952666 未加载
评论 #14950854 未加载
评论 #14955458 未加载
评论 #14950866 未加载
评论 #14958430 未加载
评论 #14950867 未加载
nhancealmost 8 years ago
If this doesn&#x27;t happen or takes too long, there&#x27;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.<p>It&#x27;s easy to type and easy to remember and should always do a good job of expressing intent of usage.
评论 #14950179 未加载
评论 #14950198 未加载
评论 #14951331 未加载
评论 #14950483 未加载
评论 #14950881 未加载
评论 #14950508 未加载
评论 #14950758 未加载
评论 #14950178 未加载
评论 #14950655 未加载
评论 #14952070 未加载
评论 #14950186 未加载
DonHopkinsalmost 8 years ago
There was the time that Keith Henson tried to explain the local loopback address to Scientology lawyers during a deposition...<p><a href="http:&#x2F;&#x2F;www.cryonet.org&#x2F;cgi-bin&#x2F;dsp.cgi?msg=6289" rel="nofollow">http:&#x2F;&#x2F;www.cryonet.org&#x2F;cgi-bin&#x2F;dsp.cgi?msg=6289</a><p>Henson: (patiently) It&#x27;s at 127.0.0.1. This is a loop back address. This is a troll.<p>Lieberman: what&#x27;s a troll?<p>Henson: it comes from the fishing where you troll a bait along in the water and a fish will jump and bite the thing, and the idea of it is that the internet is a very humorous place and it&#x27;s especially good to troll people who don&#x27;t have any sense of humor at all, and this is a troll because an ftp site of 127.0.0.1 doesn&#x27;t go anywhere. It loops right back around into your own machine.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Keith_Henson" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Keith_Henson</a>
评论 #14958224 未加载
jonathonfalmost 8 years ago
I&#x27;ve had web browsers perform a web search for &#x27;localhost&#x27;, or even just redirect me to localhost.com.<p>Annoying.
评论 #14951414 未加载
评论 #14951289 未加载
评论 #14951593 未加载
评论 #14955160 未加载
评论 #14950529 未加载
tcbawoalmost 8 years ago
At work someone once spent hours trying to resolve a network issue. Turns out he didn&#x27;t have a localhost entry in his &#x2F;etc&#x2F;hosts and some sadistic person had created a VM named &#x27;localhost&#x27; that registered a DNS entry via DHCP.
评论 #14955292 未加载
feelin_googleyalmost 8 years ago
At least on the OS I use, which is more IPv6 ready than most, &#x2F;etc&#x2F;hosts solves this &quot;uncertainty&quot; problem.<p>I have found that failing to include a localhost entry in the HOSTS file can lead to some strange behavior.<p>If there are &quot;computers&quot; out there that have no &#x2F;etc&#x2F;hosts or deny the computer&#x27;s owner access to it, then maybe it might be time for an Internet Draft from Joe User.<p>There should always be a mechanism for the user to override the internet DNS. And applications should continue to respect it.
评论 #14951764 未加载
zancheyalmost 8 years ago
We have two entries in our DNS which point to 127.0.0.1&#x2F;::1 - localhost and elvis.<p>This enables the following on Solaris and similar systems:<p><pre><code> $ ping elvis elvis is alive</code></pre>
bryanrasmussenalmost 8 years ago
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&#x2F;db-admin-path, after some sleuthing it turned out somebody &#x27;in corporate&#x27; on the network we were using had named their computer localhost.
inopinatusalmost 8 years ago
I would very much like to see this draft extended to cover SRV lookup as well.<p>Right now, section 3 of this draft would prohibit all SRV queries for localhost, which may hinder development and deployment of a SRV based application. That&#x27;s an immediate problem.<p>But not only are there existing applications to which it is immediately applicable - it is a design error in HTTP that plain address records are used for resolution. One day this will be corrected, in which case measures like this should continue to apply.
评论 #14966802 未加载
dmacedoalmost 8 years ago
Also very important to point out; this same standardisation is missing on the TLD level.<p>Both for safeguarding internal use, and making a global TLD reserved on the global DNS zones. You&#x27;ll find organisations using in production <i>.local </i>.dev (Taken by Google on 2014-11-20, followed by .app in 2015) *.zone (Taken by a LLC on 2014-01-09 ) as internal domains, with potential conflicts with the Internet&#x27;s DNS resolution.<p>More importantly .dev [1] and .zone [2] are now valid TLDs, so watch out people!<p>[1] <a href="https:&#x2F;&#x2F;www.iana.org&#x2F;domains&#x2F;root&#x2F;db&#x2F;dev.html" rel="nofollow">https:&#x2F;&#x2F;www.iana.org&#x2F;domains&#x2F;root&#x2F;db&#x2F;dev.html</a><p>[2] <a href="https:&#x2F;&#x2F;www.iana.org&#x2F;domains&#x2F;root&#x2F;db&#x2F;zone.html" rel="nofollow">https:&#x2F;&#x2F;www.iana.org&#x2F;domains&#x2F;root&#x2F;db&#x2F;zone.html</a>
评论 #14965940 未加载
评论 #14959777 未加载
评论 #14966739 未加载
sgtpepper43almost 8 years ago
Just add a line your hosts file mapping lolcathost to 127.0.0.1 and you never have to worry about it again.<p>No that&#x27;s not a typo
chr1almost 8 years ago
Does this mean that an entry in &#x2F;etc&#x2F;hosts assigning ip to localhost will be ignored?
评论 #14951478 未加载
评论 #14951481 未加载
评论 #14951296 未加载
JdeBPalmost 8 years ago
On the one hand, this isn&#x27;t exactly a new idea and in the real world has been happening for years now.<p>* dnscache from djbdns has handled &quot;localhost.&quot; queries internally all along, since 1999. It maps &quot;localhost.&quot; to 127.0.0.1 and bgack again. Various people, including me, have since added code to do the same thing with the mappings between &quot;localhost.&quot; and ::1. (<a href="http:&#x2F;&#x2F;jdebp.eu.&#x2F;Softwares&#x2F;djbwares&#x2F;guide&#x2F;dnscache.html" rel="nofollow">http:&#x2F;&#x2F;jdebp.eu.&#x2F;Softwares&#x2F;djbwares&#x2F;guide&#x2F;dnscache.html</a>) I implemented implicit localhost support in my proxy DNS servers for OS&#x2F;2, as well.<p>* It is conventional good practice to have a db.127.0.0 and a master.localhost &quot;zone&quot; file on BIND that do this. This is in Chapter 4 of the book by Albitz and Liu, for example.<p>* Unbound has built-in &quot;local zone&quot; defaults mapping between &quot;localhost.&quot; and both 127.0.0.1 and ::1.<p>On the other hand, this proposal explicitly rules out all of the aforementioned existing practice, by demanding that both proxy and content DNS servers instead return &quot;no such domain&quot; answers for the domain name &quot;localhost.&quot;. That seems like a fairly pointless deviation from what is fast approaching two decades of existing practice, for which no rationale is given and none is apparent.
ccheeveralmost 8 years ago
One time I was debugging a problem for a user of our desktop software (I work on <a href="https:&#x2F;&#x2F;expo.io" rel="nofollow">https:&#x2F;&#x2F;expo.io</a>) by sharing his screen and taking over his computer. And it turned out the reason the user was having problems was that in his &#x2F;etc&#x2F;hosts file, he had an entry pointing localhost at the IP address of some other computer on his network. Crazy. I have no idea how anything worked on his machine.<p>Took a while to track that was down. Was both bewildering and sort of satisfying to figure it out in the end.
naileralmost 8 years ago
Surprised the more common .localdomain is omitted as a domain rather than having a .localhost domain.
评论 #14954423 未加载
edurenalmost 8 years ago
Can anybody with more knowledge point out techniques that this would break?<p>Are there any software or networking patterns that currently rely on localhost _not_ resolving to the loopback?<p>EDIT: The RFC mentions that MySQL currently differentiates between the two, but that&#x27;s it.
评论 #14951212 未加载
评论 #14951148 未加载
评论 #14950556 未加载
filleokusalmost 8 years ago
<p><pre><code> The domain &quot;localhost.&quot;, and any names falling within &quot;.localhost.&quot;, are known as &quot;localhost names&quot;. Localhost names are special in the following ways […] </code></pre> Is this not implemented on macOS or am I just misunderstanding?<p><pre><code> ~ ping test.localhost ping: cannot resolve test.localhost: Unknown host ~ ping localhost.test ping: cannot resolve localhost.test: Unknown host</code></pre>
评论 #14950673 未加载
评论 #14952043 未加载
评论 #14950661 未加载
ericfrederichalmost 8 years ago
Sounds reasonable, but would probably break a ton of stuff. Does this provide enough benefits to outweigh the downsides?
评论 #14952120 未加载
age_bronzealmost 8 years ago
There was no RFC for localhost yet?! That&#x27;s pretty surprising... That this RFC have any practical meaning? People didn&#x27;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?
评论 #14950807 未加载
agwaalmost 8 years ago
To be clear, this is not an RFC yet. It&#x27;s not even adopted by a working group, although I hope it will be.<p>Mods: can RFC be removed from the title? [Edit: thanks for updating the title!]
评论 #14950788 未加载
评论 #14950310 未加载
alexellisukalmost 8 years ago
Localhost resolving to IPv6 basically breaks with Docker they unless you give special instructions only listens on IPv4. With curl for instance you can use the -4 parameter but probably best we start saying test the site on 127.0.0.1 in tutorials.
评论 #14951096 未加载
lolcalhostalmost 8 years ago
This sucks. I have registered and am actively using a &#x27;localhost&#x27; domain name under one of the new generic TLDs for for emails and account signups for quite some time now.
评论 #14950707 未加载
评论 #14950675 未加载
pmarreckalmost 8 years ago
Why couldn&#x27;t they just redirect &quot;localhost&quot; at the DNS level to 127.0.0.1?
评论 #14950595 未加载
评论 #14951408 未加载
评论 #14950570 未加载