4 ms·
On my Linux machine with systemd-resolved, this even works out the box: $ resolvectl query foo.localhost foo.localhost: 127.0.0.1 --
by lima 1y ago
On 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.
- jchw 1y agoYeah, I've been using localhost domains on Linux for a while. Even on machines without systemd-resolved, you can still usually use them if you have the myhostname module in your NSS DNS module list. https://www.man7.org/linux/man-pages/man8/libnss_myhostname.so.2.8.html 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.)
- aib 1y agoI ended up writing a similar plugin[1] after searching in vain for a way to add temporary DNS entries. The ability to add host entries via an environment variable turned out to be more useful than I'd expected, though mostly for MITM(proxy) and troubleshooting. 1: https://github.com/aib/nss-userhosts https://github.com/aib/nss-userhosts