Caveat: I know many Unices, but not Darwin/MacOS Xvery well, so some of the details may differ...
You have a few options to achieve your aim, though not necessarily by the method you describe:
- run a virtual machine for the second browser
- run a 'virtualised applcation' for the second browser (I do not know what, if any, application-virtualisation options exist for MacOS X)
- run a second browser in a chrooted environment, though you would need to populate the chroot with a lot of bits of the OS for something like a graphical browser to run
- configure one browser to use a proxy running on another machine which has different lookup information
- hook something which alters the response of a gethostbyname() call, e.g.
LD_PRELOAD=/my/special/libresolv.so /path/to/browser (the browser, like any other application does not, AIUI, read /etc/hosts directly, instead it calls gethostbyname() which is handled by libresolv which will read /etc/hosts or talk to DNS servers or other name-lookup facilities)
There might be 'sandboxed' browsers for MacOS X, usually intended for security however they might be based on an abstraction layer between browser and OS that gives you a useful starting point.