.localhost Domains
21–30 of 212 posts
Re: .localhost Domains
#22Re: .localhost Domains
#23Wow! Today I learned that you can have subdomains of localhost. Never realized it!
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 address and is reserved for such use". In other words, your server may be binding to ::1 but your browser may be resolving 127.0.0.1. I'm sure later RFCs rectify the lack of IPv6 addressing, but I wouldn't assume everyone has updated to support those.
Another neat trick to combine with .localhost is using 127.0.0.0/8. There's nothing preventing you from binding server/containers to 127.0.0.2, 127.1.2.3, or 127.254.254.1. Quite useful if you want to run multiple different web servers together.
Re: .localhost Domains
#24Each service is then exposed via '.local.'.
This has been working flawlessly for me for some time.
Re: .localhost Domains
#25Re: .localhost Domains
#26Avoid using `.local`. In my experience Chrome does not like it with HTTPS. It takes much much longer to resolve. I found a Chrome bug relating to this but do not have it handy to share. `.localhost` makes more sense for local development anyways.
Re: .localhost Domains
#27Once again, .local should _never_ have been assigned to any organization. Just like .lan should also be reserved like the private IP blocks.
Don't we have ".internal" for that?
.local also works fine, of course, if you enable mDNS and don't try to use normal DNS.
Re: .localhost Domains
#28On my Linux machine with systemd-resolved, this even works out the box: $ resolvectl query foo.localhost foo.localhost: 127.0.0.1 -- link: lo ::1 -- link: lo Another benefit is being able to block CSRF using the reverse proxy.
https://www.man7.org/linux/man-pages/man8/libnss_myhostname....
(There are lots of other useful NSS modules, too. I like the libvirt ones. Not sure if there's any good way to use these alongside systemd-resolved.)
Re: .localhost Domains
#29That's not redirection per se, a word that's needlessly overloaded to the point of confusion. It's a smart use of a reverse proxy.
It would be nice if you all reserved the word "redirect" for something like HTTP 3xx behavior.
Re: .localhost Domains
#30EDIT: on linux and don't use launchd, so I'd still the port number