Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Up front: the per browser (or per process, if you will) part is the important part here. I'm well aware of the /etc/hosts(and its Windows counterpart), but would like to avoid this system-global method.

What tools exist to override the IP for a given (i.e. configurable) name per browser? For Firefox there are "Modify Headers" and "Tamper Data". Both of them do not appear to be suitable for my case, because the DNS lookup is done before that. So I can only modify the HTTP headers (e.g. the Host header), but not influence the IP to which it gets sent. But manipulating to what IP it gets sent is exactly what I want to do.

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

That can be done using the .Net Proxy Fiddler2 and a little bit of FiddlerScript.

The sample script for redirecting traffic can be found in the sample script section "Point all requests for one server to a different server, including HTTPS tunnels" on: http://www.fiddler2.com/fiddler/dev/scriptsamples.asp

share|improve this answer
add comment

A method that works with all browsers is to set up a proxy server, such as Privoxy or Squid, that has the ability to rewrite requests. When a HTTP proxy server is used, the full URL is sent to the proxy without performing any name resolution.

share|improve this answer
    
Thanks. But how do I get the proxy to send the request to an IP that does not match the host name via DNS lookup (on the proxy)? It seems to me this ultimately just shifts the problem to the proxy ... –  0xC0000022L Apr 26 '11 at 10:13
    
Perhaps you could set up a proxy running in a chroot environment with a modified /etc/hosts, listening on a local port. Then configure each browser to use/not use this local proxy as required. A bit convoluted, but it might work. –  OrbWeaver Jul 8 '11 at 21:02
add comment

Your Answer

 
discard

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.