User version of /etc/hosts

hostnamehosts-file

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.

Best Answer

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