News for hackers. Stuff that matters.
Re:.localhost Domains by jchw on Thursday April 10, 2025 @11:01AM (#43644518)
Yeah, 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....

(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 by aib on Thursday April 10, 2025 @05:20PM (#43648115)
I 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