On a Windows machine, I would like to direct all outgoing network traffic destined for one host to another (not another IP address). So for example, all requests to host.acme.com
must go to server.ajax.net
or something like that.
What is the way to do this or what must I search for? (If I understood the correct terminology, it would make it a lot easier to search for).
(A little background on what I want to achieve: I want to set up something like UnoTelly just for myself on my machine, where requests to certain hosts are sent to an AWS Cloudfront server. For this, however, it does not suffice to resolve hostnames to different IP addresses; I must actually forward the traffic to a different host by its hostname).
Best Answer
The simplest way to do that is to use the machine's host file:
c:\windows\system32\drivers\etc\hosts
file (yes, there is no extension) with any text editor. You might need to start the editor with a high security token (run as administrator" if UAC is enabled1.2.3.4 host.acme.com
(where 1.2.3.4 is actually the IP address of your destination machine)
Save the file, and you're done. Note, however, that this will just change the IP address of the machine that you'll connect to when using the
host.acme.com
dns host name. It will not change anything in the content of these connections so if you're using a protocol like HTTP (or SSL) where the host name is embedded into the data, the target machine might not respond properly.