i want a programme to do this thing .
fakeresolv www.example.com=220.127.116.11 -- wget www.example.com/abc
this way i can test vhost's of my webserver without setting up dns records . i want to limit this effect on one process or one process tree . i want uninvolved processes resolve hostnames with the regular resolver .
wget here is for example . i want this facility to wrap many other programmes .
i think LD_PRELOAD and ptrace(2) are candidate approaches . but have small experience on the detail implementation . if there is another programme does something similar , i may use that as a reference . so before i want to start my own code , what existing project is good to look at ?