Is it possible to configure user specific hosts file instead of a common /etc/hosts.
For example if user "user1" tries to get the name for the IP: "127.0.0.1", he gets "dev.user1" and if user "user2" tries to get the name for the same IP, he gets "dev.user2".
Best Answer
No, you cannot have a per-user /etc/hosts file, or anything like /home/user1/.hosts , etc.
You are using gethostbyaddr which is hardcoded to follow the instructions in nsswitch.conf, which itself tells gethostbyaddr to look in /etc/hosts .
You might be able to do something like add additional loopback IPs on the 127.0.0.0/8 network, like 127.0.0.2 , 127.0.0.3, 127.1.2.3, and then assign a local hostname to one of these local IPs. We did this at one job, but I remember that this really confused our engineers.
Also, if I remember right some loadbalancers actually do this internally.
Here's an example /etc/hosts to illustrate my point:
As @blacklotus suggested earlier, the more common way to do this is to designate part of your local network as a "Developer LAN".