I am a user on a Solaris 10 system and I wish to maintain my own version of /etc/hosts. This file will function like a normal /etc/hosts, except it will only resolve hosts from processes that I run.
Since I do not have the ability to write to /etc/hosts and I do not wish to have to ask the adminstrator to reconfigure it for me. (please don't go into this more)
I am open to other alternatives that will allow a non-privileged user the ability to add custom host names. The solution must not involve the superuser doing anything.
Override gethostbyname. You'll need to control the library path, but that can be done by a user. See here for some neat info:
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
A chrooted environment or even a dedicated non global zone might be a solution for you. Otherwise, an interposition library or a dtrace script might also do the job.