TL;DR
nss-userhosts is a glibc Name Service Switch extension that enables unprivileged users to create personal /etc/hosts-like entries. It currently supports parsing configuration files and adheres to the XDG specification for directory management.
✦ Why It Matters
Start using nss-userhosts today to manage your own hostname mappings without needing root access.
Key Takeaways
Full Summary
nss-userhosts is an extension library for the GNU C Library (glibc) that enables unprivileged users to maintain their own hostname mappings, similar to the traditional /etc/hosts file. This tool is still in early development but is functional, allowing users to define custom hostname entries in configuration files located in their home directory.
It supports both IPv4 and IPv6 address formats, but lacks features like reverse name resolution and adherence to the XDG specification for directory management. To use nss-userhosts, users must build the library, rename it appropriately, and configure glibc to recognize it by modifying the /etc/nsswitch.conf file.
Users can then create their own host entries and test them using the getent command. Debugging is facilitated through an environment variable that enables logging of module activity.
Related