Live data from Hacker News

Let 'localhost' be localhost

tools.ietf.org

21–30 of 117 posts

Re: Let 'localhost' be localhost

#21

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.

The proper way to do it, though it does mean that things such as using ssl for wildcard domains at an arbitrary level become difficult and potentially expensive.

Re: Let 'localhost' be localhost

#23
post #13
post #5

Earlier quoted context omitted.

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

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.

Re: Let 'localhost' be localhost

#26
post #7
post #4

Maybe I'm overthinking this, but wouldn't a better solution be to say that server1.localhost doesn't have to be loopback, but that it must be resolved by asking the DNS server at localhost (or alternatively defined in the hosts file). edit: I don't really have any expertise or experience with this at all, just a thought.

I think people already hosting their own DNS server at localhost don't need to worry about real domain allocations as they can spoof whatever they want for development. I think reserving .localhost for loopback would be great for my workflow. Maybe it would check hosts for overrides before going straight to loopback?

isn't that the role of .localdomain tho?

Re: Let 'localhost' be localhost

#27
post #22

There are several "localhost. " domains in the wild today. What happens to those?

> There are several "localhost. " domains in the wild today. What happens to those? nothing. the rfc talks only about the localhost tld.

Ah, you're right. Thanks for clarifying.

Re: Let 'localhost' be localhost

#28

Just so we're clear. All these domains would just go away? https://iwantmyname.com/?domain=localhost

No. This draft describes a change by which localhost becomes effectively a new TLD in which all names map to the loopback address. Names in other TLDs won't be affected.

Re: Let 'localhost' be localhost

#30
post #8

I'm not very networking-wise, got a question: is the "local machine" alwyas a well-defined thing? I'm thinking about stuff like where hosts are transparently distributed. Maybe there are systems out there that take advantage of resolving localhost to other than 127.* in order to make applications easy to transparently migrate when scaling servers out, or something?

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