Live data from Hacker News

.localhost Domains

inclouds.space

51–60 of 212 posts

Re: .localhost Domains

#51

You might check out .internal instead which was recently approved [1] for local use. [1]: https://en.wikipedia.org/wiki/.internal

In that case I would prefer naming as

  ..internal
So for example

  phpbb.mtndew.internal
And I’d probably still add

  phpbb.localhost 
To /etc/hosts on that host like OP does

Re: .localhost Domains

#52
post #32

Earlier quoted context omitted.

.localhost is in the same list as .example and .invalid when it comes to reserved names: https://datatracker.ietf.org/doc/html/rfc2606 It's a neat trick, but it comes with some caveats. For instance, `localhost` often resolves to both 127.0.0.1 and ::1, but `.localhost` is described in RFC2606 as "traditionally been statically defined in host DNS implementations as having an A record pointing to the loop back IP addr…

But is "foo.localhost" a valid domain name, for cookies and such?

The RFC treats .localhost as a full TLD. I believe Windows does as well, as does Ubuntu (using default systemd-resolved), but macOS doesn't seem to resolve .localhost by default, necessitating the host file trickery.

Of course, in the early internet, the difference between a TLD and a host name weren't quite as clear as they are right now.

Re: .localhost Domains

#54
post #34

Earlier quoted context omitted.

Honestly, if I had my druthers there would be a standardized exception for .local domains that self-signed HTTPS certs would be accepted without known roots. It's insane how there's no good workflow for HTTPS on LAN-only services.

It’s actually gotten worse, you need to run a CA or use a public domain where it’s easy to get your internal naming schemes in a transparency log.

The easy workaround I've seen companies use for that is by using a basic wildcard certificate (*.local.mydomain.biz).

Re: .localhost Domains

#56
post #53

As a reminder, lacolhost.com and all subdomains will forever resolve to localhost (well for as long as I'm around at least)

> As a reminder, lacolhost.com …

I’m assuming that typo is intentional?

Re: .localhost Domains

#57
post #53

As a reminder, lacolhost.com and all subdomains will forever resolve to localhost (well for as long as I'm around at least)

> (well for as long as I'm around at least)

Rather big caveat IMO. As a side note, your domain doesn't seem to have an AAAA record (which [.]localhost binds to by default on most of my machines, at least).

Re: .localhost Domains

#58
I have a public domain that resolves to a static lease in my internal network, which is running nginx proxy manager.

When I add a new site to my local setup, I just define a CNAME in Cloudflare and add an entry in Nginx proxy manager. It handles SSL via wildcard cert.

Re: .localhost Domains

#59
post #34

Earlier quoted context omitted.

Honestly, if I had my druthers there would be a standardized exception for .local domains that self-signed HTTPS certs would be accepted without known roots. It's insane how there's no good workflow for HTTPS on LAN-only services.

Technically speaking you could use DANE with mDNS. Nobody does it, browser don't implemented it, but you can follow the spec if you'd like. Practically speaking, HTTPS on LAN is essentially useless, so I don't see the benefits. If anything, the current situation allows the user to apply TOFU to local devices by adding their unsigned certs to the trust store.

Some more modern browser APIs only work in HTTPS. That's why I had to do it.

Re: .localhost Domains

#60

You might check out .internal instead which was recently approved [1] for local use. [1]: https://en.wikipedia.org/wiki/.internal

The *.home.arpa domain in RFC 8375 has been approved for local use since 2018, which is long enough ago that most hardware and software currently in use should be able to handle it.
Post reply on HN