Live data from Hacker News

Internet Draft: Let 'localhost' be localhost

tools.ietf.org

131–140 of 179 posts

Re: Internet Draft: Let 'localhost' be localhost

#131
post #89

At least on the OS I use, which is more IPv6 ready than most, /etc/hosts solves this "uncertainty" problem. I have found that failing to include a localhost entry in the HOSTS file can lead to some strange behavior. If there are "computers" out there that have no /etc/hosts or deny the computer's owner access to it, then maybe it might be time for an Internet Draft from Joe User. There should always be a mechanism fo…

I remember in the late 90s running into a "mysterious" problem where www.hotmail.com would fail to load, but hotmail.com (without www.) worked just fine. Spent the better part of a year just remembering to not type "www." until one day they made the domain redirect to the canonical name (breaking both). After asking around a bit, someone showed me where the Windows equivalent of /etc/hosts was, and lo-and-behold, the…

I discovered a few weeks back that my Android build has dnsmasq installed in the system directories. Apparently stock.

It's not running. But ... you could have fun with that.

Re: Internet Draft: Let 'localhost' be localhost

#133

Earlier quoted context omitted.

Not necessarily. The requirement for applications concerned about security properties of localhost names is that the resolved address is bound to a loopback interface, in order to satisfy the test in section 5.1 of this draft. However, I expect many application developers to mistakenly assume that only 127/8 and ::1 are valid loopback interface addresses.

Or, indeed, to assume (as I did for many years) that only 127.0.0.1 itself is a valid loopback address. I was rather surprised when I looked it up and found that it was the entire 127 block.

I use multiple addresses in this block for local DNS servers, both authoritative and recursive, and various local proxies. Alternatively I can clone tap devices and assign them RFC 1918 addresses. However the loopback works better in my experience.

As an end user, I use /etc/hosts not only as a substitute for DNS but also in addition to it.

For example I may block/redirect a mostly noxious domain via wildcard in a customized root zone file on computer1 (an "authoritative nameserver" for a "recursive cache" that serves computer2) but then edit the HOSTS file on computer2 to make an impromptu single exception for a particular subdomain. Ideally I would prefer to run local DNS and local proxies on computer2 like computer1, but with many of today's "computers" this is infeasible; so computer2 might use computer1 for name lookups, routing, etc., as suggested by another commenter.

There are other ways to make these adjustments but editing a text file that is always present and in the same location is quick and dirty, immediate and particularly easy. This is only one use. HOSTS is quite useful in a variety of situations.

IMHO, the use of local computer1 as a gateway/server for another such as local computer2 only becomes even more important as we see a rise in "computers" that are resistant to manual control by the end user, such as those mentioned by another commenter.

Without having the ability to do IP forwarding, packet filtering, run localhost DNS servers and localhost proxies, as an end user I would struggle to control the internet traffic[1] of many of today's "computers" where the manufacturers have preconfigured them to serve their own interests and attempted to lock users out from making changes.

1. e.g., ad blocking, disabling incessant phone home behavior and other bandwidth conservation measures

In short, I need to be able to control the address for "localhost" without relying on or having to worry about DNS. HOSTS achieves that without the complexity and politics of DNS.

Re: Internet Draft: Let 'localhost' be localhost

#134
post #27
post #18

Earlier quoted context omitted.

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.

It doesn't though. Unless I'm missing something obvious, it only has an A record, not a AAAA.

Re: Internet Draft: Let 'localhost' be localhost

#136

Earlier quoted context omitted.

Hey, Firefox's still alive and kicking. It's quite ancient, comparatively speaking. :-) Old wisemen may refer to it as a fire-breathing reptile, others a bird clad in flames. And despite suffering from declining market share in recent years, prophecy foretold that it will one day rise from the red ashes, stronger and more resilient than ever! (Apologies for running away with the joke)

Firefox has the awesome bar, which works almost exactly like Chrome's omnibox.

Vivaldi has both the chrome omnibar and a separate search input.

Re: Internet Draft: Let 'localhost' be localhost

#137

Earlier quoted context omitted.

> the Windows equivalent of /etc/hosts Which is, bizarrely, etc\hosts (somewhere in C:\Windows\). I've always wondered why they felt the need to make an 'etc' folder just to have the hosts file in it.

Software historians differ on the degree to which the Windows NT 3.1 TCP/IP stack & utilities were derived from BSD, but it's one possible reason.

A very diplomatic way of putting it.

Re: Internet Draft: Let 'localhost' be localhost

#138
post #89

Earlier quoted context omitted.

I remember in the late 90s running into a "mysterious" problem where www.hotmail.com would fail to load, but hotmail.com (without www.) worked just fine. Spent the better part of a year just remembering to not type "www." until one day they made the domain redirect to the canonical name (breaking both). After asking around a bit, someone showed me where the Windows equivalent of /etc/hosts was, and lo-and-behold, the…

> the Windows equivalent of /etc/hosts Which is, bizarrely, etc\hosts (somewhere in C:\Windows\). I've always wondered why they felt the need to make an 'etc' folder just to have the hosts file in it.

C:\windows\system32\drivers\etc\hosts

and, if i remember correctly from my windows days, not only did they make the whole 'etc' folder just to put the hosts file in, the strangely-named 'drivers' folder didn't have anything else in it either.

Re: Internet Draft: Let 'localhost' be localhost

#139
post #97

Earlier quoted context omitted.

Ideally, a server binding to "localhost" should create a listening socket for each of its IP addresses (e.g. 127.0.0.1 and ::1), and a client connecting to "localhost" should try each IP address in order, until one succeeds. But a lot of standard libraries (including parts of Java and Go) get this wrong, and pick exactly one IP address arbitrarily. When you combine a buggy client with a buggy server, and their prefer…

Or use a single socket for both protocols (set the IPV6_V6ONLY socket option to false).

That works when binding to :: (all interfaces), but it's irrelevant when binding to "localhost", because you can only bind one address per socket.

Re: Internet Draft: Let 'localhost' be localhost

#140

I've had web browsers perform a web search for 'localhost', or even just redirect me to localhost.com. Annoying.

chrome does this. if i dont specify http or https before domain chrome will try to search any .dev or .loc or ... domain with googe search engine.

anoying

Post reply on HN