Live data from Hacker News

Let 'localhost' be localhost

tools.ietf.org

11–20 of 117 posts

Re: Let 'localhost' be localhost

#11
post #5

Maybe someone should standardize internal TLD(s) for corporate and other use cases that would make developers less sad, as at least they have alternatives.

.local ? https://en.m.wikipedia.org/wiki/.local

Unfortunately that is less and less possible due to multicast DNS which hijacked that TLD.

Re: Let 'localhost' be localhost

#12

Isn't there a problem here? This draft says: IPv4 loopback addresses are defined in Section 2.1 of [RFC5735] as "127.0.0.0/8". That's not perfectly true. RFC5735 defines 127/8 as loopback addresses, but it leaves the door open for other addresses to be assigned to the loopback interface. And indeed doing so is a common pattern for network devices, and a less common (but very useful) pattern for services. So let's say…

Symbolic way to force a local application locally as follows:

16:04:25 speedy :{~} $ cat /etc/hosts

   ##
   # Host Database
   #
   # localhost is used to configure the loopback interface
   # when the system is booting.  Do not change this entry.
   ##
   127.0.0.1       localhost
   10.1.1.1        servicelocalhost

Re: Let 'localhost' be localhost

#13
post #5

Maybe someone should standardize internal TLD(s) for corporate and other use cases that would make developers less sad, as at least they have alternatives.

.local ? https://en.m.wikipedia.org/wiki/.local

Like the linked wikipedia article says, .local is used by mDNS(zeroconf/bonjour/avahi/etc.), so you might see weird stuff if you use it for a "normal" DNS environment.

AFAICT current "best practice" for private networks is to use a private subdomain of your real domain. Say, .internal.example.com.

Re: Let 'localhost' be localhost

#14
-1 from me. 'localhost' is an artifact of a model of network computing that is no longer relevant; it's a special case of the general antipattern of network-topology sensitive design.

Back in the bad old days only a single user on a physical computer could log into a windows domain, because it was possible look up what user (singular) was on a host. Of course domain logins were also exquisitely sensitive to the nature of the network between client and server as well. It was a nightmare. Localhost is a product of that kind of thinking.

One-per-host resources that have to be shared across all users, security perimeters, vms, containers, etc. are an unwelcome headache. Of course, real systems don't actually share a localhost between all of these things, resulting in the even goofier concept of "which localhost do you mean?" That question was exactly why site-local addressing was deprecated from ipv6 https://tools.ietf.org/html/rfc3879

An actually portable standard for resolving well-known local entities would be great, but more special cases to try to fix the doomed localhost idea is a move in the wrong direction.

Re: Let 'localhost' be localhost

#17
post #14

-1 from me. 'localhost' is an artifact of a model of network computing that is no longer relevant; it's a special case of the general antipattern of network-topology sensitive design. Back in the bad old days only a single user on a physical computer could log into a windows domain, because it was possible look up what user (singular) was on a host. Of course domain logins were also exquisitely sensitive to the natur…

I guess the authors understand that "localhost" is not an ideal authentication mechanism, however, the fact is that many application do use it as such. And the reason why they decided to come up with the RFC, to at least fix this on the level of DNS resolvers.

(And I am not sure this thinking will ever be dead, it's kind of extension of notion of "territory" for physical objects, and you can still pretty safely assume that whatever is in my home is my own.)

Re: Let 'localhost' be localhost

#18

Is there an actual case to be made for pointing localhost to anything other than the loopback device?

Only if you are intent on using a hack to produce an unmaintainable system. Making 'localhost' point to anything other than loopback is just asking for trouble. People will do it because they can, but not because they should.

Re: Let 'localhost' be localhost

#19

Maybe someone should standardize internal TLD(s) for corporate and other use cases that would make developers less sad, as at least they have alternatives.

Before the gTLDs were expanded it was easy: just choose an unused word. These days I tend to see either subdomains of the main public domain, or a public domain registered solely for internal use.

Re: Let 'localhost' be localhost

#20
post #15
post #11

Earlier quoted context omitted.

Unfortunately that is less and less possible due to multicast DNS which hijacked that TLD.

Isn't .private reserved?

Yes, but that just means they can decide to do something special with it in the future, not that you can use it for your own purposes.
Post reply on HN