Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing on my local machine and I need to have a browser run on one host file and another browser run on a different host file.

One browser would run a host file to redirect to my local machine. The second browser would run a host file to redirect to a external product server.

Is this possible?

Btw, I can't rename the local machine to lets say

I'm running mac os x

share|improve this question

migrated from May 23 '11 at 10:33

This question came from our site for system and network administrators.

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/ /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.

share|improve this answer
+1 for running a virtual machine with the second browser. I actually find it useful to have a virtual machine running the exact same setup as the live machine so I'm sure it will work in both places. – Scott Keck-Warren May 23 '11 at 12:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.