Live data from Hacker News

Let 'localhost' be localhost

tools.ietf.org

111–117 of 117 posts

Re: Let 'localhost' be localhost

#111
post #68

Earlier quoted context omitted.

No, if your application is distributed, you won't be referring to localhost.

And why not? If we are running distributed services, we know the machine that the code is run on is running. We can even reference this by many languages version of "this" keyword. localhost is only "this" for IP4/6

I think the GP meant that the client won't be calling on the server through 'localhost', at least not as a hard-coded parameter.

Re: Let 'localhost' be localhost

#112

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

Chrome on Android lets you bind your phone/tablet's localhost to your computer's localhost. This enables you to test during development, even if your corporate IT people disallow connections between devices on the same WiFi network (or partition personal devices onto a different network than corporate hardware).

Hey that's a neat trick. If I'm reading the docs[1] correctly, as far as the application is concerned it is connected to the loopback. The same thing happens when I `ssh -L :localhost: `.

I think it also follows the spirit of the idea since the change is local to the machine you're using.

[1] https://developers.google.com/web/tools/chrome-devtools/debu...

Re: Let 'localhost' be localhost

#113
I think for non-DNS experts (like me) it's important to know that in DNS terminology, the notation "tld." is used to donate top-level domains. (Note the trailing period)

So ".localhost." means "every domain within the 'localhost' tld", not "every domain that contains the string 'localhost'".

Re: Let 'localhost' be localhost

#114
post #99

Earlier quoted context omitted.

Thankfully IPv6 defined a single "localhost" or loopback IP: ::1/128 There is none of this 127/8 mess.

that "mess" is great for testing though, you can spin up numerous instances each on their own loopback address.

You can use a link local address of your public interface in IPv6.

Re: Let 'localhost' be localhost

#115

Earlier quoted context omitted.

Google registered the .dev gTLD for their internal use. So I've been doing the same, hijacking all requests for the .dev gTLD and serving up my own zones.

That's fine until Google buys your company. :)

I will not be that sad.

Re: Let 'localhost' be localhost

#116
post #99

Earlier quoted context omitted.

that "mess" is great for testing though, you can spin up numerous instances each on their own loopback address.

You can use a link local address of your public interface in IPv6.

That's just one, adding more require elevated privileges, with 127.0.0.0/8 you have 256³ at your disposal.

Re: Let 'localhost' be localhost

#117
post #39

I have had a number of customers who have broken our applications, which have daemons listening on localhost, by editing their /etc/hosts files and removing the localhost entry. I guess various people edit /etc/hosts to prevent applications from talking to licensing servers, and in the process happen to accidentally blow away the localhost entry (since these customers don't know what they're doing). We had this happe…

While some people might edit their host for nefarious purposes, I think it's wrong to attribute all of it to malice. Personally, I set the host file to use https://github.com/StevenBlack/hosts in order to block ads on every computers I touch. I also often use software that manage the host file and ignore the default physical file.

Every one of the cases I have had to debug in which someone had deleted the localhost entry was someone who had entries for blocking Adobe's licensing servers.
Post reply on HN